Karteikarten
SOLID Principles
Karten in diesem Stapel (6)
- 1What are the 5 principles of SOLID?Single Responsibility Principle
Open-closed Principle
Liskov Substitution Principle
Interface Segregation Principle
Dependency Inversion Principle - 2What the Single Responsibility Principle?“Gather together those things that change for the same reason, and separate those things that change for different reasons.”
- 3What is the Open-closed Principle?Entities should be open for extension but closed for modification:
i.e. It should be simple to change the behaviour of an entity
Separate the extensible behaviour behind an interface and flip the dependencies - 4What is the Liskov Substitution Principle?Derived classes must be
substitutable for their base classes:
1. Signature must match
2. The pre-conditions cannot be greater than the parent e.g. an if() guard clause.
3. Post-conditions at least equal to
4. Exception types must match - 5What is Interface Segregation Principle?A client should not be forced to
implement an interface it never uses. - 6What is the Dependency Inversion Principle?Depend on abstractions and not concretions
High level modules (e.g. PasswordReminder) should not depend on low level modules (e.g. DbConnection class)
Informationen
- Beschreibung
- Professional Software Engineering Karteikarten am SOLID Principles, erstellt von Ben Parish am 07/05/2019.
- Erstellt von
- Ben Parish
- Aufrufe
- 0
- Bewertung