Re: How to identify if a concept should be represented as a entity or as a value obj
"sudarshan89" <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
Nice post thanks. --- In [email protected], Giacomo Tesio <giacomo@...> wrote: > > I have no value object holding pointers to any entity. > > Shared identifiers > <http://epic.tesio.it/doc/manual/shared_identifiers.html> proved > very well when adressing the need of values that need to refer to an entity > (see the "Decoupling Entities" section). > > Indeed identifiers are values (thus I model them as value objects). > > > Giacomo > > On Mon, Feb 25, 2013 at 5:12 PM, sudarshan89 <sudarshan89@...> wrote: > > > ** > > > > > > Point taken. > > > > Could we say that a Value object would never hold a reference to an entity > > ? > > > > A Value Object would always be composed of other value objects ? > > > > > > --- In [email protected], Giacomo Tesio wrote: > > > > > > I model entities after the expert's language, when he talks with his own > > > peers he use a name to identify an entity while he describes value > > objects. > > > > > > For example, in a financial application he could use the RIC or the ISIN > > to > > > identify an entity, but he doesn't identify a monetary amount. > > > > > > > > > Giacomo > > > > > > > > > > > > On Mon, Feb 25, 2013 at 5:58 AM, Remy Fannader wrote: > > > > > > > ** > > > > > > > > > > > > > > Entities have a life-cycle of their own while the life-cycle of VOs is > > set > > > > by their use. > > > > That means that entities can identified independently and accessed by > > > > unknown applications. > > > > > > > > > > http://caminao.wordpress.com/how-to-represent-objects-and-activities/identities-2/identities/ > > > > Remy. > > > > > > > > On 25 February 2013 06:46, sudarshan89 wrote: > > > > > > > >> ** > > > > > >> > > > >> > > > >> > > > >> I am trying to find out what question one must ask during the > > modelling > > > >> process to detect if a concept should be modeled as a entity or as a > > value > > > >> object. > > > >> > > > >> My current understanding is the below > > > >> > > > >> If in our domain a car engine can be swapped out and put in another > > car > > > >> then it has existence of its own (Aggregation) and hence cannot be a > > Value > > > >> Object ... However in our domain if the engine cannot be swapped out > > and > > > >> hence makes no sense without a car then it can be modeled as a Value > > Object > > > >> (Composition). Does this make any sense ? > > > >> > > > >> Please let me know what you think > > > >> > > > >> Thanks > > > >> > > > >> > > > > > > > > > > > > > > > > > > ------------------------------------