Inheritance vs enum properties in the domain model

后端 未结 6 1025
予麋鹿
予麋鹿 2020-12-13 09:07

I had a discussion at work regarding \"Inheritance in domain model is complicating developers life\". I\'m an OO programmer so I started to look for arguments that having in

6条回答
  •  抹茶落季
    2020-12-13 09:42

    I'd urge you to reconsider: in an anemic domain model (per the comments above), cats don't behave differently than dogs, so there's no polymorphism. An animal's type really is just an attribute. It's hard to see what inheritance buys you there.

提交回复
热议问题