Principles of SOLID

¡Supera tus tareas y exámenes ahora con Quizwiz!

Open-Closed Principle (O.C.P)

- "Objects or entities should be open for extension, but closed for modification." - That is, such an entity can allow its behavior to be modified without altering its source code."

Benefits of S.R.P​

- Better cohesion​ - Improved readability​ - Easier to debug/test (fewer test cases)​ - Lower coupling​ - Improved usability (separation of concerns)

Single-Responsibility Principle (S.R.P)​

- Every object should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility. - "A class should have one and only one reason to change, meaning that a class should have only one job."

Why use S.O.L.I.D?

Makes code:​ - More maintainable​ - Easier to extend without breaking existing functionality​ - Easier to read and understand ​ - Less rigid (difficult to change)​ - Less fragile (prone to break in many, often unrelated places)​ Less immobile (more reusable)

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

S - Single-responsibility principle​ O - Open-closed principle​ L - Liskov substitution principle​ I - Interface segregation principle​ D - Dependency Inversion Principle


Conjuntos de estudio relacionados

Macroeconomics Exam 3: Chapter 20

View Set

40- Immune Cells & Lymphoid Organs

View Set

MCC Marketing Chapter 18: Social Media

View Set

Principles of Marketing HW Problems Chpt. 10-13

View Set

unidad 1 los cambios en la estructura familiar

View Set

Fundamental Managerial Accounting Concepts

View Set

Inför franska prov > 3/3 - 2023

View Set

Physical Science: Chapter 9.1 & 9.2 QUIZ

View Set

HealthStream Hazard Communication

View Set