Principles Flashcards

1
Q

What is the S.O.L.I.D. Principle?

A

Single Responsibility
A class should have one and only one reason to change. AKA separation of concerns. Makes implementation easier and prevents unexpected side effects of future changes.
Open/Closed
Software entity should be open to extension, but closed for modification. Write code so that adding new functionality does not change the existing code. (Inheritance can be used to achieve this.)
Liskov Substitution
This principle defines that objects of a superclass (Parent) shall be replaceable with objects of its subclasses (Children) without breaking the application. (Similar to design by contract concept)
Interface Segregation
Clients should not be forced to depend upon interfaces they do not use.
Dependency Inversion
Depend upon abstractions, not concretes. (Separate initialization and usage of a dependency)

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

What is the K.I.S.S principle?

A

**Keep It Simple, Stupid **states states that most systems work best if they are kept simple rather than making it complex, so when you are writing code your solution should not be complicated that takes a lot of time and effort to understand.
**In KISS principal we neither want less nor more, we only want to have as much as is required. **

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

What is the D.R.Y. Principle?

A

**Dont Repeat Yourself **
Every discrete chunk of knowledge should have one, unambiguous, authoritative representation within a system. The goal of the DRY principle is to lower Technical debt by eliminating redundancies in process and logic whenever possible.

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