-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Aggregate Root, Entity, ValueObject, DomainEvent abstracts #374
Comments
We discussed this issue quickly on the Jakarta Data call yesterday. It's my opinion—and I believe that the others agree—that:
The idea of "design patterns" is that they're patterns, not APIs. On the call we agreed that this issue can now be closed. |
We can not avoid the patterns in the real world application development. If we do not embrace the concept of DDD, here the Data Repository is just a DAO in the classic J2EE Design Patterns. In an AggregateRoot, we hope can maintain the data easily in a root graph. |
Of course, @hantsy, if you can identify a concrete problem that makes it hard to implement the aggregate pattern using Jakarta Data, then please let us know what it is. I assert that there is no such concrete problem, and that it's trivially easy to implement aggregates with Jakarta Data. And I have the following very good reason for believing that: we know for sure that Jakarta Data works well with document databases, and so we can directly infer that it works just as well for someone who wants to simulate a document database using a relational database. And that's all the "aggregate" pattern is: it's an attempt to shoehorn a tree-like data model onto relational tables. |
In Eric's DDD, a
Repository
is tightly tied with Aggregate Root, and used to maintain the lifecycle of a Aggregate Root. And a Aggregate Root could be consist of Entity, Value Objects, and can handle domain events. Have a look at jmolecules project: https://github.com/xmolecules/jmolecules/tree/main/jmolecules-ddd/src/main/java/org/jmolecules/ddd/typesIn a JPA, it is easy to maintain the lifecycle like relation between PurchaseOrder and OrderItems, but switching to Jdbc(assume there is a data-jdbc module), it should apple changes to the whole Aggregate when calling a repository save/update etc.
The text was updated successfully, but these errors were encountered: