Category: Principles

"There are two parts to learning craftsmanship: knowledge and work." - Robert C. Martin

odwrócenia zależności

Dependency Inversion Principle

According to the Dependency Inversion Principle, all dependencies should depend on abstraction, not on a particular type. So a high-level class should not depend on a low-level class, but both classes should depend on abstraction. High level modules (classes) are most often responsible for important strategic decisions and models of a given application. Therefore, they…
Read more

Zasada segregacji interfejsów

Interface Segregation Principle

The Interface Segregation Principle states that interfaces should be small and specific. So that classes do not implement methods that they do not need. This principle has in particular the task of eliminating bulky, unnecessarily complex interfaces. Each interface in accordance with this principle should be divided into smaller groups of methods. The program presented…
Read more

Liskov

Liskov Substitution Principle

The Liskov substitution principle tells us that any derived class can be used in a base class location. Hence the interface and all methods must be maintained. This rule is consistent with open/closed principle, as the derived class does not affect the behavior of the parent class. This means that derived classes must be substitutable…
Read more

Zasada otwarte/zamknięte

Open/Closed Principle

According to the open/closed principle, each class should be open to development, but closed to modifications. Classes should be written in such way that at each stage of application development there is possibility of extending them. The extension of such class should be carried out without the need to modify it in existing part of…
Read more

Zasada pojedynczej odpowiedzialności single responsibility principle

Single Responsibility Principle

The single responsibility principle is that each class should be responsible for one particular thing. This means more or less that there should not be more than one reason to modify a given class. The application of this principle in the code significantly increases the number of classes in the program. Many small classes are…
Read more