Design Principles and Patterns
Design Principles and Patterns
Patterns
GROUP 1
Overview of Design Principles
S: Single Responsibility Principle (SRP) – This is one of the basic principles most developers apply to build
robust and maintenance software. This suggests that each software module, class, or interface should have
only one (1) reason to change.
O: Open-Closed Principle (OCP) – This states that for a software to be easy to change, the software classes
must be designed to allow the behavior of those classes to be changed by adding new code rather than
changing existing code.
L: Liskov Substitution Principle (LSP) – Barbara Liskov introduced this principle which states that derived
clases should be substitutable for their base classes to build a software from interchangeable modules or
classes.
I: Interface Segregation Principle (ISP) – This principle advises software designers to avoid depending on
things that they don’t use.
D: Dependency Inversion Principle (DIP) – This principle suggests that flexible software are those with
classes that depend on abstract classes or interfaces.
Following these priciples help
developers to achieve the following:
A. High-level classes should not be dependent on low-level classes. Both of them should
depend on abstractions.
- Is a class does something significant in the application, while a low-level class is a class that
does secondary work.
B. Abstractions should not depend upon details. Details should depend upon abstractions.
- This means that developers must design the abstract class by looking at the needed details of
of the class.