#1 2015-02-03 18:33:36

ludydoo
Member
Registered: 2015-01-27
Posts: 17

Question on DTOs, Entities and Aggregate Roots

Hi,

I'm a bit confused. I read the documentation concerning DTOs, Value Objects, Entities and Aggregate Roots, but I have difficulty imagining how they could be implemented.

I looked at all the examples too, but could not find anything about them.

I understood that Value Objects are instances that hold a value (instances TTelephoneNumber, TPostalCode).

I see that DTOs should be immutable : for data transfer only. They can hold values like telephone number, integer, string...

I see that Entities are more like "logical" objects. Things corresponding to the business model. They have properties and value-object properties...

Then, Aggregate roots are like a hierarchy (w list and nested values) of entities and value objects.


I am confused on how would that be implemented. How would an aggregate root be implemented? Would that be a TSQLRecord?

How can Value Object and DTOs declarations be shared between client and server?

I think a larger example would be necessary, one including Aggregate roots, DTOs, Value Objects, Entities, Services, Service Factory... would be necessary !

If anyone can provide one, that would be nice!

Offline

#2 2015-02-03 21:35:41

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Question on DTOs, Entities and Aggregate Roots

Yes, I know, this is a lot of material!

I'm currently adding some DDD dedicated classes and types, as part of the framework.
See http://synopse.info/fossil/finfo?name=S … MotDDD.pas
With an upcoming full sample.

Please wait a little, and I'm quite sure you will find the path in the upcoming code.

Offline

#3 2015-02-03 22:17:06

martin.suer
Member
Registered: 2013-12-15
Posts: 76

Re: Question on DTOs, Entities and Aggregate Roots

http://dddsample.sourceforge.net/index.html This link provides some solid information and example code (in Java) and helped me to get a quick start on DDD along side with Eric Evan's book

Last edited by martin.suer (2015-02-03 22:18:35)

Offline

#4 2015-02-03 23:39:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Question on DTOs, Entities and Aggregate Roots

@martin
Yes this is the classic reference code.
I never found this sample very clear.
The whole objects definition do not clearly set the bounded context.
Even the architecture page is misleading.
The code itself is obfuscated by javaisms and hibernatisms, and I was always lost in the plumbing.
Tests are not even appearing.
And the application layer is clearly leaking the domain.

A more accurate set of ideas for implementing DDD is detailed in http://www.infoq.com/articles/ddd-in-practice

Offline

Board footer

Powered by FluxBB