Is OO design's strength in semantics or encapsulation?

后端 未结 11 1375
余生分开走
余生分开走 2021-01-30 23:28

Object-oriented design (OOD) combines data and its methods. This, as far as I can see, achieves two great things: it provides encapsulation (so I don\'t care what data there is,

11条回答
  •  盖世英雄少女心
    2021-01-31 00:25

    Encapsulation in conjunction with Polymorphism. The ability of classes in most OOP languages to implement one or more interfaces has had the biggest impact on the development of my software. This feature allows me to precisely define the interaction between two object.

    Not only define the interactions but document it so that years later I can return to that section of code and see what is happening clearly.

    This feature is the main reason why I prefer using OOP languages over functional languages. While very powerful I have found software written in functional languages to be a pain to maintain when the maintenance cycle is measured in decades. (AutoLisp software found in AutoCAD)

提交回复
热议问题