On Tue, May 12, 2009 at 6:45 PM, Aye <[email protected]> wrote: > This is more of a modeling discussion. Let's say that there's a bunch > of paint manufacturing companies and they all want to have their own > available paint colors so that customers can pick which color they > want from a company. The paint companies can activate or deactivate > the colors they are offering. The paint colors are enumerations but > specific to their own respective paint company. Usually I would say > the paint color would be Value composites since they only make sense > under the respective paint company but when it comes to the scenario > where the customer is picking the color, it sounds like the paint > itself should be an entity. > > Usually in the UI, it's a select list or a bunch of radio buttons; > when the paint is selected and if the paint is an entity then I can > directly use the paint in a transaction but if it was a value > composite, I would have to look up the company first and then look for > the paint. I've actually done it both ways in previous projects but > was never sure if I was following a domain concern or letting the UI > drive the model. > > Any thoughts?
I have in fact worked on a similar domain (dyes for textiles) and what we did was that the "Colors" (actually Reflection samples) were both Entity and Values depending on what they were used for. I had a feeling that we overused the Entity bit, probably due to having to use SQL databases which are not good with network graphs. So, when a Reflection measurement was made, it was actually an Entity, since with it came Date, Description, Who sampled, What equipment was used, and later on could be annotated with an arbitrary set of properties. But when a color was converted into one of many other things (for instance, Target Color for Dye Recipe) then it became a Value of the Recipe entity. HTH Cheers -- Niclas Hedhman, Software Developer http://www.qi4j.org - New Energy for Java I live here; http://tinyurl.com/2qq9er I work here; http://tinyurl.com/2ymelc I relax here; http://tinyurl.com/2cgsug _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

