How do I reduce duplication of domain/entity/DTO objects?

前端 未结 1 914
别跟我提以往
别跟我提以往 2020-12-23 17:22

I am in the process of redesigning my current project to be more maintainable, and doing my best to follow good design practices. Currently I have a solution with a Silverli

相关标签:
1条回答
  • 2020-12-23 18:18

    Having 3 almost identical classes can't possibly be the right way to go about this, can it?

    IMO they aren't "3 almost identical classes", they don't serve the same purpose. They are rather multiple facets of the same domain notion, each one tailored for the needs of a specific layer.

    It's the price to pay for modularity and clear separation of concerns. The more ports (as in Hexagonal Architecture's Ports & Adapters) you have, the more facets you'll need and the more mapping you'll have to do.

    A good article on this : http://blog.ploeh.dk/2012/02/09/IsLayeringWorththeMapping/

    0 讨论(0)
提交回复
热议问题