Skip to content

Why are Software Design Principles important? , SOLID principles and Other principles (DRY, KISS, YAGNI) 💻 .

Notifications You must be signed in to change notification settings

Raogurucharan/Software-Design-Principles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Software-Design-Principles

Defining the SOLID principles in layman's terms :

  1. Single Responsibility : Make things (classes, functions, etc.) responsible for fulfilling one type of role. e.g. Refactor code responsibilities into separate classes.

  2. Open/Closed : Be able to add new functionality to existing code easily without modifying existing code. e.g. Use abstract classes. These can define what subclasses will require and strengthen Principle 1. by separating code duties.

  3. Liskov Substitution : When a class inherits from another class, the program shouldn't break and you shouldn't need to hack anything to use the subclass. e.g. Define constructor arguments to keep inheritance flexible.

  4. Interface Segregation : Make interfaces (parent abstract classes) more specific, rather than generic. we can do this using anathor way by also using Composition by creataing seperate classes. e.g. Create more interfaces (classes) if needed and/or provide objects to constructors.

  5. Dependency Inversion : Make classes depend on abstract classes rather than non-abstract classes. e.g. Make classes inherit from abstract classes.

CREDITS : @ArjanCodes

About

Why are Software Design Principles important? , SOLID principles and Other principles (DRY, KISS, YAGNI) 💻 .

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages