SOLID Flashcards
What does “S” In SOLID stand for?
Single responsibility principle
What does “O” In SOLID stand for?
Open/closed principle
What does “L” In SOLID stand for?
Liskov substitution principle
What does “I” In SOLID stand for?
Interface segregation principle
What does “D” In SOLID stand for?
Dependency inversion principle
Define Single responsibility principle
A class should have only a single responsibility (i.e. changes to only one part of the software’s specification should be able to affect the specification of the class)
Define Open/closed principle
“software entities … should be open for extension, but closed for modification.”
Define Liskov substitution principle
“objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.” See also design by contract
Define Interface segregation principle
“many client-specific interfaces are better than one general-purpose interface.”
Define Dependency inversion principle
one should “depend upon abstractions, [not] concretions.”
How many design patterns are recognized by the Gang of Four
23
Name the three categories of the Gang of Four design patterns
Creational, Structural, Behavioral
Name the 5 Creational Patterns
Abstract Factory, Builder, Factory Method, Prototype, Singleton
Name the 7 Structural Patterns
Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy
Name the 11 Behavioral Patterns
Chain of responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor