How to avoid having very large objects with Domain Driven Design

后端 未结 6 853
猫巷女王i
猫巷女王i 2020-12-24 13:29

We are following Domain Driven Design for the implementation of a large website.

However by putting the behaviour on the domain objects we are ending up with some ve

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-24 14:02

    A very simple rule of thumb to follow is "most of the methods in your class HAVE to use most of the instance variables in your class" - if you follow this rule the classes will be automatically of the right size.

提交回复
热议问题