M10 Object-Oriented Design Principles (SOLID)

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/19

flashcard set

Earn XP

Description and Tags

Flashcards covering software design fundamentals and SOLID principles, including Single Responsibility, Open/Closed, Liskov’s Substitution, Interface Segregation, and Dependency Inversion Principles.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards

Type Casting

Changing a primitive data type to another (e.g., int to double). Can be widening (implicit) or narrowing (explicit).

2
New cards

Class type casting Widening (implicit)

Parent P = new Child().

3
New cards

Class type casting Narrowing (Explicit)

Child C= new Parent().

4
New cards

Software Design

Complex activity of software development life cycle.

5
New cards

Four Types of Designs

Data, Architectural, Procedure, and User Interface.

6
New cards

Keep Design quality

Following canonical solutions/principles, code refactoring.

7
New cards

Design Quality Assurance Levels

Method and Class level.

8
New cards

Bad Code Smells at Method Level

God method (more than one operation), Fan-in (inputs), Fan-out (output).

9
New cards

Bad Code Smells at Class Level

God class (class has more than average methods or responsibilities).

10
New cards

Good Object-Oriented Design

Follow design principles and modularize responsibilities.

11
New cards

Need for Good Design

Reduce maintenance effort and cost.

12
New cards

Responsibilities of an object (i.e. Behavior)

Operations other than initialization and assignment.

13
New cards

Aims of SOLID Principles

To reduce tight coupling between classes and reduce maintenance cost, improve reusability, flexibility, and stability.

14
New cards

SOLID Principles

Single Responsibility Principle (SRP), Open/Closed Principle, Liskov’s Substitution Principle (LSP), Interface Segregation Principle (ISP), Dependency Inversion Principle (DIP).

15
New cards

Single Responsibility Principle (SRP)

A class should have only one reason to change; every class should have a single responsibility, job, or purpose.

16
New cards

Benefits of SRP

Remove concept of god class, reduce complexity, improve testing.

17
New cards

Open/Closed Principle (OCP)

A class should be open for extension but closed for modification.

18
New cards

Liskov’s Substitution Principle (LSP)

Every subclass or derived class should be substitutable for their parent or base class, conforming to the “is-a” relationship.

19
New cards

Interface Segregation Principle (ISP)

Clients should not be forced to implement unnecessary methods they will not use; prefer small, client-specific interfaces.

20
New cards

Dependency Inversion Principle (DIP)

High-level modules must never rely on low-level modules; use abstraction rather than concretions to remove hardcoded dependencies for loosely coupled applications.