3

Domain objects (aggregates and entities) are only exposing behavior and no dummy getter() or setter() methods. If I don't want to use an ORM in a repository which is capable of extracting internal state by means of reflection, then how a repository is supposed to get internal state of an aggregate?

Majid Azimi
  • 223
  • 2
  • 6
  • There is no answer there, but it is still a duplicate. – Basilevs Nov 28 '16 at 09:09
  • 1
    Expose a DTO and give your domain objects internal conversion to and from it. – Ewan Nov 28 '16 at 09:17
  • @Ewan I added a comment to the following question. You mean something like this? http://softwareengineering.stackexchange.com/questions/266425/best-practices-for-serialization-of-ddd-aggregates#comment720725_266437 – Majid Azimi Nov 28 '16 at 09:24

0 Answers0