Inheritance vs enum properties in the domain model

后端 未结 6 1024
予麋鹿
予麋鹿 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:32

    Having an enum is like throwing a party for all those Open/Closed Principle is for suckers people.

    It really invites you to check if an animal is of a certain type and then apply custom logic for each type. And that can render horrible code which makes it really hard to continue building on your system.

提交回复
热议问题