Main concepts in OOP

后端 未结 14 2155
夕颜
夕颜 2020-12-07 17:03

I was once asked in an interview \'What are the 3 main concepts of OOP?\'. I answered by saying that in my opinion there were 4 which are as follows:

  • Inheritan
14条回答
  •  佛祖请我去吃肉
    2020-12-07 17:32

    It's generally believed that those are the main principles however they had very little to do with why OO was created.

    One of the guiding principles was the direct manipulation metaphor. That is creating an object in the program that represented an object from the users mental model. Most of the motivation for creating OO was based in psychology not math/CS as is often believe to be the case these days.

    If doubtfull of this take a look at some of the work by Trygve Renskauge. Father of MVC and DCI or James Coplien accomplish author and speaker.

    So I'd say you likely gave them an answer close to what they expected whether it's correct depends on where you stand.

提交回复
热议问题