SOLID Principles

It’s a very important principle in OOP.
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 it’s subclass instance without causing any trouble
Interface segregation: interface should be divided into smaller and more specific interface, so that any class who implement this interface won’t be forced to implement methods he doesn;t need it at all.
Dependency inversion: program needs to rely on the abstract interface instead of any specific implementation.

posted @ 2020-10-29 10:16  EvanMeetTheWorld  阅读(19)  评论(0)    收藏  举报