SOLID principles

 SOLID:

1. S - SRP: The single responsibility principle. A class should have one, and only one, reason to change.

This means that every class, or similar structure, in your code should have only one job to do. 

2. O - OCP: The Open Closed Principle. You shoul be able to extend a classes behaviour, without modifying it. Open to extention means that you shoul design your classes so that new functionality can be added as new requirements are generated. Closed for modifications means that once you have developed a class you shoud never modify it, except to correct bugs.

3. L - LSP: Liskov substitution priciple. Derived classes must be substitutable for ther base classes. That means we have to construct our hierarchy from simple to complex. So that complex extends from simple. 

4. I - ISP: The interface segregation principle. It states that client should not be forced do depend upon interface members they do not use.

5. D - DIP: Dependency inversion principle. It states that high-level modules should not depend upon low-lewel modules; they should depend on abstractions. Secondly, abstractions should not depend upon details; details hould depend upon abstractions.

Комментарии

Популярные сообщения из этого блога

Lesson1: JDK, JVM, JRE

SE_21_Lesson_11: Inheritance, Polymorphism

SE_21_Lesson_9: Initialization Blocks, Wrapper types, String class