- Jan 2024
-
www.theodinproject.com www.theodinproject.com
-
You should take care, however, to make sure that your individual objects can stand alone as much as possible. Tightly coupled objects are objects that rely so heavily on each other that removing or changing one will mean that you have to completely change another one - a real bummer.
Isn't there a conflict between this principle and code reusability?
-
- Sep 2023
-
en.wikipedia.org en.wikipedia.org
-
An object in object-oriented language is essentially a record that contains procedures specialized to handle that record; and object types are an elaboration of record types. Indeed, in most object-oriented languages, records are just special cases of objects, and are known as plain old data structures (PODSs), to contrast with objects that use OO features.
-
- Oct 2022
-
blog.appsignal.com blog.appsignal.com
-
If we would have kept the call to super out of the #initialize_dup method, we would never have called initialize_copy, so it is important to keep that in.
-
- Mar 2022
-
github.com github.com
-
rom-rb.org rom-rb.org
-
Object hierarchies are very different from relational hierarchies. Relational hierarchies focus on data and its relationships, whereas objects manage not only data, but also their identity and the behavior centered around that data.
-
- Jun 2021
-
graphql-ruby.org graphql-ruby.org
-
(Always call super to inherit the default behavior.)
-
-
docs.gitlab.com docs.gitlab.com
-
Adding Object Oriented Principles (OOP) to a functional codebase adds yet another way of writing code, reducing consistency and clarity.
-
- Mar 2021
-
www.sitepoint.com www.sitepoint.com
-
For instance, those who prefer classical inheritance may enjoy the addition of the class keyword, while others may reject it as conflicting with the idea of a prototypical inheritance model.
-
-
trailblazer.to trailblazer.to
-
Internally, it creates and returns a fresh, subclassed activity (via patching) whilst replacing the step for given :id. Be advised that this does not change the original activity class.
-
- Feb 2021
-
www.martinfowler.com www.martinfowler.com
-
It reminds us that rather than asking an object for data and acting on that data, we should instead tell an object what to do.
-
-
en.wikipedia.org en.wikipedia.org
-
I think a better, more immediately understandable name for this concept would be command object, because it lets you pass around commands (or a list of commands) as objects.
That's the only thing you really need to know abut this pattern. The rest seems like boring implementation details that aren't that important, and that naturally follow from the primary definition above.
-
The central ideas of this design pattern closely mirror the semantics of first-class functions and higher-order functions in functional programming languages. Specifically, the invoker object is a higher-order function of which the command object is a first-class argument.
-
-
en.wikipedia.org en.wikipedia.org
-
In object-oriented programming, information hiding (by way of nesting of types) reduces software development risk by shifting the code's dependency on an uncertain implementation (design decision) onto a well-defined interface. Clients of the interface perform operations purely through it so if the implementation changes, the clients do not have to change.
-
-
www.infoworld.com www.infoworld.com
-
Though getter/setter methods are commonplace in Java, they are not particularly object oriented (OO). In fact, they can damage your code's maintainability. Moreover, the presence of numerous getter and setter methods is a red flag that the program isn't necessarily well designed from an OO perspective.
-
- Jan 2021
-
doc.rust-lang.org doc.rust-lang.org
-
The changes we needed to make to main to reassign post mean that this implementation doesn’t quite follow the object-oriented state pattern anymore: the transformations between the states are no longer encapsulated entirely within the Post implementation. However, our gain is that invalid states are now impossible because of the type system and the type checking that happens at compile time! This ensures that certain bugs, such as display of the content of an unpublished post, will be discovered before they make it to production.
This is really an amazing chapter for comparing (some aspects) of object oriented and functional programming, and I have to admit I still prefer the functional approach as a default.
-
- Oct 2020
-
en.wikipedia.org en.wikipedia.org
-
-
"Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program." See also design by contract.
-
-
en.wikipedia.org en.wikipedia.org
-
some programming languages that provide lexical closures view encapsulation as a feature of the language orthogonal to object orientation.
-
- Sep 2020
-
jsreport.io jsreport.io
-
A paradigm is a model or pattern. In JavaScript, there are a number of popular paradigms including object-oriented programming (OOP) and functional programming (FP). Paradigms are more important than is sometimes recognized. They help form mental models for solving problems. Becoming well-versed in the principles of a given paradigm can help accelerate development by providing mental shortcuts for solving the challenges that arise while building applications. They can also help produce higher quality software.
-
- Feb 2019
-
en.wikipedia.org en.wikipedia.org
-
for example, comments and identifiers
Some better illustrated examples can be found in UBCx: SoftConst2x - Software Construction: Object Oriented Design's course lecture on Coupling.
-
- Jan 2019
-
courses.edx.org courses.edx.org
-
If one object is part of another object, then we use a diamond at the start of the arrow (next to the containing object), and a normal arrow at the end.
Another way of thinking of this is, if the original owner (source) object and the owned (target) object share the same life cycle -- that is, the owned exists only when the owner does -- we say that the owner aggregates owned object(s). They share a whole-part relationship.
What I did like very much about the video, was when the instructor pointed out that there's a small fallacy: aggregation, in OOD, does not really imply that owned object(s) must be a list.
-
-
www.bitwig.com www.bitwig.com
-
Grid devices can be nested or layered along with other devices and your plug-ins,
Thanks to training for Cycling ’74 Max, had a kind of micro-epiphany about encapsulation, a year or so ago. Nesting devices in one another sounds like a convenience but there’s a rather deep effect on workflow when you start arranging things in this way: you don’t have to worry about the internals of a box/patcher/module/device if you really know what you can expect out of it. Though some may take this for granted (after all, other modular systems have had it for quite a while), there’s something profound about getting modules that can include other modules. Especially when some of these are third-party plugins.
-
- Mar 2018
-
en.wikipedia.org en.wikipedia.org
-
a mutator method is a method used to control changes to a variable. They are also widely known as setter methods
For example, a method definition in Java would be:
class MyClassDef { public void setProperty(String propertyVal) { .. } }
For above, setProperty(..) method is the mutator
-