Is OO design's strength in semantics or encapsulation?

后端 未结 11 1394
余生分开走
余生分开走 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:04

    Encapsulation and the resulting abstraction are clearly the main strengths of OO. The "things" predicate what "actions" can be invoked on them, so nouns take on a higher semantic importance than verbs.

    Ultimately, it's hard to envision designing a complex system in a consistent and maintainable form without some level of encapsulation.

提交回复
热议问题