Re: Re: How to identify if a concept should be represented as a entity or as a value obj
Jörgen Andersson <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <CAFp=OHnT8Y=4MA5MLNkbfqvw10smtC4FNAwpJfufNsgp2DDQnQ@mail.gmail.com> |
Yes, you can say that. I would say, an entity is a domain object where you care for its identity. A value object is where you care only for its values. However, an entity in one context might be a value object in another, so there are no one-size-fits-all. Jörgen ** 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 > >> > >> > > > > >