I look at ID only as a means of associating objects in the persistence
store.

Entities by definition have an unique identity and the ID column with a
generated value is a pretty good way of modeling this.

Value objects could have an synthetic surrogate key for persistence, but
given the immutable and often 'flyweight' nature of value objects, perhaps
an natural key that directly represents the value is more appropriate? For
colour, this might be a name or an RGB code, depending on your domain.

Using a natural key naturally limits the set and supports the concept of
flyweight re-usable value object pool.


On Wed, Aug 5, 2009 at 2:43 AM, Roger Kratz <[email protected]>wrote:

>
> Yes, that's how <component>s behave. Suits fine with the behaviour of ddd's
> value objects (even though the term doesn't concern about persistance afaik)
>
> (I don't know if it's possible to create your own IUserType to persist
> stuff in seperate tables. I haven't done it at least.)
>
> ________________________________
> Från: [email protected] [[email protected]] för Everett
> Muniz [[email protected]]
> Skickat: den 4 augusti 2009 17:26
> Till: [email protected]
> Ämne: [nhusers] Re: DDD, value objects and IDs
>
> Thanks for the link Roger.
>
> If I understand the custom value type support correctly, it assumes that
> the columns necessary to 'hydrate' the value object class are all available
> on the table to which the containing entity is mapped.  Is that correct?  In
> other words, it doesn't look like the custom value type support deals with
> the situation where the columns for the value type live in another table.
>  Is that how you understand it?
>
>
>
> >
>


-- 
Andy Hitchman

email: [email protected]
mobile: +61 423 180 729
linkedin: http://www.linkedin.com/in/andyhitchman

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to