Should an object know its own ID?
obj.id
seems fairly common and also seems to fall within the range of something an object could know about itself. I find myself asking why should my object know its own id?
FP for simulation and modelling
I’m about to start a simulation/modelling project. I already know that OOP is used for this kind of projects. However, studying Haskell made me consider using the FP paradigm for modelling a system of components. Let me elaborate:
What is a good design model for my new class?
I am a beginning programmer who, after trying to manage over 2000 lines of procedural php code, now has discovered the value of OOP. I have read a few books to get me up to speed on the beginning theory, but would like some advice on practical application.
The Meaning of Unified in UML
UML and other related modelling languages are exists in most of the system engineering fields to represent the system, flow, relations in a structured way. UML also is one of the modelling language used in computer science like other industries to represent the systems in obeject oriented way by using different types of diagrams. Does ‘Unified’ UML has a special (or real) meaning here?
Should Equality be commutative within a Class Hierachy?
It is easy to define the Equals
operation in ways that are not commutative. When providing equality against other types, there are obviously situations (in most languages) were equality not being commutative is unavoidable. However, within one’s own inheritance hierarchy where the root base class defines an equality member, a programmer has more control.
When to use identity comparison instead of equals?
I wonder why would anybody want to use identity comparison for fields in equals
, like here (Java syntax):
Tips about how to spread Object Oriented practices [closed]
Closed 9 years ago.
Which order to define getters and setters in? [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for […]
About anonymous objects
In Java particularly Android development, is there any difference between declaring an object like
How far should an entity take care of its properties values by itself?
Let’s consider the following example of a class, which is an entity that I’m using through Entity Framework.