I started reading chapter 5 of E. Evans DDD and try to make head or tail of the concepts.
In context of ddd what is and what is not entity and what is value object ?
looking at Value object or entity object in my Hibernate mapping? - but it is about Hibernate, not DDD, I ask about DDD
- In above sample of hibernate OrderLine is Entity, but is OrderLine still a DDD entity ?
- And more generally, can we say that any jpa/Hibernate @Entity is DDD entity, or not ?
- It seems to me, that OrderLine is a good example of Jpa/Hibernate entity that is not a DDD entity, is it ?
If we for instance had used some object database we would possibly store Order togeter with it's OrderLines, wouldn't we ?
- In terms of relational databases could we say, that Jpa @Entity that is mapped in database as OnDeleteCascade is not a DDD Entity, but it is still a value object ?
- Is hibernate @Embedded always a DDD value object ? (seems yes, it has no identity)
Ok, and now other case with other doubts. Lets say that we have two different systems one in Java other in Python. One for billing other for marketing. Both of them have a Customer Entity.
- Do we say that BillingCustomer is the same DDD Entity as MarketingCustomer (assuming both of them represent the same Customer John Doe born 01.01.1980 wiht ssn 12-34-56)? This would imply that in java two different classes, even not having common parent (except from Object) can represent the same DDD entity. If so, how should equals be implemented in above classes ?
- Should java equals return true for two different java classes representing the same DDD entity ?
Aucun commentaire:
Enregistrer un commentaire