What is the OOD/OOP?

OOP: object-oriented programming is about creating objects that contain both data and methods. And use these objects to do what we want to do. It actually make our program easy to maintain, modify and debug.
There are four important principles in OOP: (AEIP)
Abstraction
Encapsulation
Inheritance
Polymorphism

OOD: it is a inner process of Object-oriented process, and the process is (OOA->OOD->OOP), it standardized the results of OOA and pass those thing to OOP.
There are Five important principles in OOD:
Single responsibility : every single class should just do one thing
Open closed: extension but not modification
Liskov substitution: any instance in any place, we can just replace it with its subclass instance without causing any trouble
Interface segregation: interface should be divided into smaller and more specific interface, so that any class who implements this interface won’t be forced to implement methods he doesn;t need it at all.
Dependency inversion: program need to rely on the abstract interface instead of any specific implementation.

posted @ 2020-11-24 00:14  EvanMeetTheWorld  阅读(37)  评论(0)    收藏  举报