Учи, SOLID, #####!
Актуальная (относительно)
ситуация в разработке
Пора на другой проект
Почему все меняется?
WHAT IS SOLID?
It's a PHILOSOPHY
Это НЕПРОСТО!
SRE
Single Responsibility Principle
The single responsibility principle is a computer programming principle that states that every module, class, or function should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class, module or function.
Gather together the things that changes for the same reasons. Separate those things that change for different reasons.
Основная причина для изменения
-
Person
-
Department
OCP
Open-Closed Principle
You should be able to extend the behavior of a system without having to modify that system.
LSP
Liskov Substitution Principe
If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T, the behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of T.
ISP
Interface Segregation Principle
You should segregate your interfaces
DIP
Dependency Inversion Principle
The Dependency Inversion Principle (DIP) tells us that the most flexible sestems are those in which source code dependencies refer only to abstractions, not to concretions.
Вопросы?
Twitter: @NikolaevArt
Email: artem@nikolaev.by
SOLID Principles
By Artem Nikolaev
SOLID Principles
- 113