Design Principles / Patterns Flashcards

1
Q

What are the 5 Solid principles?

A
  1. Single-responsibility principle: “Every class should only have 1 responsibility”
  2. Open-closed principle: “Classes should be open for extension but closed for modification”
  3. Liskov substitution principle: “Methods that use references to superclasses must be able to use subclass objects without knowing it”
  4. Interface segregation principle: “Many client specific interfaces are better than one general purpose interface”
  5. Dependency inversion principle: “Depend upon abstractions, not concretions”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is inversion of control?

A

Inversion of control is a design principle which states that objects should be created and managed by a framework

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

True or False

Once the first layer is debugged, its correct functioning can be assumed while the second layer is debugged, and so on. If an error is found during the debugging of a particular layer, the error must be on that layer, because the layers below it are already debugged. Thus, the design and implementation of the system are simplified

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

True or False

A monolithic system is tightly coupled whereas a layered system is losely coupled. Layer 0 is the layer that is closest to hardware and layer n is the user

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly