isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Pliessnig <p.pliess...@gmx.net>
Subject Re: How to display value object
Date Tue, 15 Aug 2017 15:18:25 GMT
Hey Kevin

What other behaviour has replaced ValueAdapters?

Cheers
Patrick


Am 15.08.2017 um 11:55 schrieb Kevin Meyer:
> Hi Ekko,
>
> I believe Dan has answered the question that you asked. However I think it
> is worth mentioning that (as I see it), Apache Isis does not treat the
> different objects in the way that I think you are considering them.
>
> While DDD may make the distinction between "value" and "entity" e.g. [1],
> in Apache Isis, all annotated objects are entities and persisted to the
> database.
>
> By annotating a "value" object e.g. in [2] with @PrimaryKey (and @Column),
> you are declaring that that are to be persisted - that they are entities.
>
> In your case "CustomerContactInfomation" is an entity. You just want to
> subordinate maintenance and viewing to the Customer entity.
>
> True DDD "value" objects (which are also immutable) would not be persisted
> in their own table - there is no need and you'd fill up a table with old
> entries that are no longer needed (the Location in the example [1]).
> To me, the "immutable" aspect of a value object means that *if* you did
> persist it to a table, you'd want to delete the old entry as soon as the
> value changes or the reference count drops to zero.
>
> In Apache Isis you would make them properties of the parent. It was once
> possible to write ValueAdapters that could serialise a value class into
> (one or more) columns of the table used to persist the "parent" entity and
> the framework would maintain (serialise/deserialise) these "value" object
> properties for you.
> However these ValueAdapters are no longer supported (the behaviour is now
> achieved in other ways).
>
> In short - in Apache Isis all "database" annotated objects are entities.
> But you can tweak the presentation of data from these entities with the
> use of annotations and actions (on the "parent") to enforce the
> subordination expected of a "value" object.
>
> Cheers,
> Kevin
>
> [1] http://culttt.com/2014/04/30/difference-entities-value-objects/
> [2] https://stackoverflow.com/a/45662839/56880
>
>> Hi support,
>>
>>
>> I'm building project with Apache Isis,but I have some confusion.
>>
>>
>> In DDD,I know there have two objects,entity & value object.
>>
>>
>> When I plan a DomainObject,eg. Customer, a entity object. I think one
>> Customer may be have many value objects,for example contact information
>> or other value objects.
>>
>> So I plan a value object called CustomerContactInformation,may be have
>> other value objects.
>>
>> For the database,a entity object and its value objects may be persist to
>> diff tables.
>>
>> I think CustomerContactInformation just a value object,it can not have
>> any actions and should be maintained by Customer.
>>
>> In fact,Customer-CustomerContactInfomation definitely is 1-1.
>>
>>
>> Now,how should I display CustomerContactInformation in Customer's layout
>> and be able to edit CustomerContactInformation?
>>
>> Any ideas?
>>
>>
>> Ekko
>>
>>
>>
>


Mime
View raw message