Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 2.29 KB

README.md

File metadata and controls

37 lines (22 loc) · 2.29 KB

SOLID-design-principles

This is tutorial that describes SOLID design principles with real-world examples. Also examples of good and bad code are given in specific design principle.

In object-oriented computer programming, SOLID is a mnemonic acronym for five design principles to make software more understandable, flexible and maintanable. The principles are a subset of many principles promoted by American software engineer and instructor Robert C. Martin.

Though they apply to any object-oriented design, the SOLID principles can also form a core philosophy for methodologies such as agile development or adaptive software development. The theory of SOLID principles was introduced by Martin in his 2000 paper Design Principles and Design Patterns, although the SOLID acronym was introduced later by Michael Feathers.

Author

  • Ivan Žagar

Content

S - Single responsibility principle

Thranduil77/SOLID-design-principles/Single_responsibility_principle

A class should have only a single responsibility, that is, only changes to one part of the software's specification should be able to affect the specification of the class.

O - Open–closed principle

Thranduil77/SOLID-design-principles/Open_closed_principle

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

L - Liskov substitution principle

Thranduil77/SOLID-design-principles/Liskov_substitution_principle

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

I - Interface segregation principle

Thranduil77/SOLID-design-principles/Interface_segregation_principle

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

D - Dependency inversion principle

Thranduil77/SOLID-design-principles/Dependency_inversion_principle

One should "depend upon abstractions, [not] concretions".