Why should I isolate my domain entities from my presentation layer?

后端 未结 14 2754
南旧
南旧 2020-12-02 04:07

One part of domain-driven design that there doesn\'t seem to be a lot of detail on, is how and why you should isolate your domain model from your interface. I\'m trying to c

14条回答
  •  死守一世寂寞
    2020-12-02 04:55

    I disagree.

    I think the best way to go is to start with domain objects in your presentation layer UNTIL IT MAKES SENSE TO DO OTHERWISE.

    Contrary to popular belief, "Domain Objects" and "Value Objects" can happily co-exist in the presentation layer. And this is the best way to do it - you get the benefit of both worlds, reduced duplication (and boilerplate code) with the domain objects; and the tailoring and conceptual simplification of using value objects across requests.

提交回复
热议问题