java - DDD: Can anyone explain the diffrences between DTO, Aggregate Root and Detached Entity? -


I am a bit worried about the differences between these three, I have considered being a customer -> Address Relations (JPA ) Will be equally near a different unit (curious loading is estimated). Where is the need for additional routes? Where is the need for DTO? Is it all the same or the same?

One reason may be that there is some information in the J.P.A. Compliance Entity, the customer has no interest in the bus, e.g. @Entity , @ ID , @OneToMany .

I can easily convert JSAX / XML using JAX-RS / -Wes and almost every customer can deal with it, so where is it needed to be? Is it all alike or does I miss something important?

You gross root If you follow the DDD principles, Are using or not This is one of the very basic building blocks in DDD. From Eric Evans's DDD Book Book:

Overall the scope of the mark, in which it is necessary for the life therapist to maintain irreversibility at all levels. Work on the following patterns, factories and treasures, aggregates.

DTO and separate entity are related to JPA (technical barriers). An total root is also an unit . When the total route is unmanaged (by persistence context), it is called separate entity .

Perhaps your question can be re-entered: Should I come back as Total Root as separate entity or DTO? The answer is subjective and depends on your environment.

As a whole root of different unit you do not need to create a new DTO class You Total Root You can also call methods owned by you; The damage will not usually populate the complete object graph for display reasons, because some total roots can have a very deep hierarchy without having to handle it properly But lazy loading will create exceptions.

Returning to DTO instead of gross root is considered to be a more robust design Total Root each 'Use Case' You will need to create a new Dto class. It is probably very cumbersome for a small system, but if you are using DDD, then I believe that your requirement is complex.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -