Hi,
I have a client-server app here. The domain model runs on the server, while the client uses the application layer without any awareness of the domain layer. That means that the the client and the server exchange DTO's defined in the application layer.
DTO's for entities are ok, because they are quite different from the entities themselves. But value objects and their DTO's are almost the same (especially enums). I'm thinking about a pragmatic approach where I don't have to copy the classes. I have three ways to go and each of them is flawed:
- The idea of referencing the domain layer from the application layer and reusing domain value object classes looks wrong to me.
- Referencing the application layer from the domain is even worse.
- Splitting the domain layer into "values" and "entities" has the risk of the "values" part containing things not really needed to the domain layer.
Any thoughts are more than welcome.
Thanks,
Sergey