Are there any rules for OOP?

前端 未结 6 618
走了就别回头了
走了就别回头了 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

    There are no "Rules" to OOP.

    There are 4 language properties that make a language object-oriented or not (these are the things you listed in your question).

    The rest of the material out there are guidelines. The best/most helpful guidelines I've read are GRASP

    Many of the suggestions are not readily understandable by laymen (non-CS majors). I thought GRASP was pragmatic and approachable.

    I think GRASP is nice because it suggests the most critical part of OO in its name - Assignment of Responsibility (to objects not programmers).

    The two most critical GRASP concepts from which everything else derives are coupling and cohesion. These two concepts/principals drive all other patterns and approaches.

    BTW - did I just interview you? You transcribed the question incorrectly...

提交回复
热议问题