e.Embedded Value

  1. Motivation
    1. Maps one or more fileds of database in to a single object to provide more meaning full value in terms of domain model.
  2. Summary
    1. An Embedded Value maps the values of an object to fields in the record of the object's owner.
    2. This is one of those patterns where the doing of it is very straightforward, but knowing when to use it a little more complicated.
    3. Embedded Value has been called a couple of different names in its history. TOPLink refers to tit as aggregate mapping. Visual Age refers to it as composer.
    4. It is mostly used with other data modeling pattern like Foreign Key Mapping and several ORM framework has built in support for standard value objects

  3. When to Use
    1. If you're mapping to an existing schema, you can use Embedded Value when a table contains data that you split into more than one object in memory.
    2. Embedded Value can only be used for fairly simple dependents. A solitary dependent, or a few separated dependents, works well. 
    3. Serialized LOB works with more complex structures, including potentially large object subgraphs.
  4. References
    1. http://martinfowler.com/eaaCatalog/valueObject.html