Fundamentals / Principles Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

CS Fundamentals

What are the principles in the SOLID acronym?

A
Single responsibility
Open-closed
Liskov substitution
Interface segregation
Dependency inversion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

CS Fundamentals

Define (SRP) Single responsibility principle

A

Software entities should have only a single responsibility.
i.e. only one potential change in the software’s specification should be able to affect the specification of the class.

MOST IMPORTANT!

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

CS Fundamentals

Define (OCP) Open/closed principle

A

Software entities should be open for extension, but closed for modification.

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

CS Fundamentals

Define (LSP) Liskov substitution principle

A

Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.

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

CS Fundamentals

Define (ISP) Interface segregation principle

A

Many client-specific interfaces are better than one general-purpose interface.

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

CS Fundamentals

Define (DIP) Dependency inversion principle

A

Depend upon Abstractions. Do not depend upon concretions.

Think: Dependency injection (DI)

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