Re: [domaindrivendesign] Re: Repositories for lookups
- Okay. If you are referring to the maintenance of value objects then,
for the purpose of maintenance, do we temporarily treat the value
objects (in any other context) as entities? I think this a reasonable
variation, and not incorrect given the context.
Context is everything.
On Sun, Sep 28, 2008 at 12:39 PM, ryzamm <ryzamm@...> wrote:
> I think we need to separate Value Object to 2 types. One is initial
> list value object and another one is runtime value object (i'm not
> sure the term is correct or not).
> Let's take initial list value object concept. Initial list value
> object is like a data to represent in lookup/dropdownlist, for example
> country. We need to create a value object for all valid country in the
> 1. United State
> 2. China
> 3. Russia
> 4. ...
> So the question comes to whom the managing responsibility should we
> put? Do we need to have GenericAdmin repository or GenericValueObject
> repository for maintenance?
> Another type of value object is a runtime value object meaning that we
> only create new instance when needed. For example Person entity and
> Address value object. Normally we don't put address in dropdownlist
> for client to select the address . Person A have reference to AddressA
> and then PersonB join to live in the same address, if we want to add
> PersonB address, we should check if the value we add already exist or
> not if yes we just make a reference AddressA to PersonB but if Person
> B live next to PersonA, so when we check the address value no value
> equality exist then we will create a new instance of AddressB and set
> a reference for PersonB.I think for the second type quite clear the
> saving value object will be responsible by the entity who use that
> value object. Type 1 still not clear to me
> --- In firstname.lastname@example.org, "Jonathan Harley"
> <jdharley@...> wrote:
>> The class that uses the value object stores its reference via the
>> repository for the using object.
>> On Sat, Sep 27, 2008 at 7:53 AM, ryzamm <ryzamm@...> wrote:
>> > How about if i want to stick that State is a Value Object and i
>> > to store it to the State table itself. So when it comes to save
>> > the database who will take this responsibility? If i have Person
>> > entity which is contain State Value Object does Person Repository
>> > the saving of State value? How about if i have more than one
>> > entity refer to the same State value?
>> > Thanks
>> A long habit of not thinking a thing wrong, gives it a superficial
>> appearance of being right, and raises at first a formidable outcry
>> defense of custom.
>> -Thomas Paine
A long habit of not thinking a thing wrong, gives it a superficial
appearance of being right, and raises at first a formidable outcry in
defense of custom.