Are there any rules for OOP?

前端 未结 6 607
走了就别回头了
走了就别回头了 2020-11-29 17:17

Recently I heard that there are 9 rules for OOP(Java). I know only four as Abstraction, Polymorphism, Inheritance and Encapsulation. Are there any more rules for OOP?

6条回答
  •  情歌与酒
    2020-11-29 18:04

    Not sure about any rules. All these mentioned things are more like OO paradigms to me. There are few advices we follow like,

    • Separation of Concern
    • Single Responsibility per Class
    • Prefer Composition over Inheritance
    • Programming to Interface
    • Plus all mentioned by Billybob, already

提交回复
热议问题