eman-hamad / solid_principles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SOLID Principles

This repository contains dart code examples and explanations for the SOLID principles in object-oriented programming.

What are the SOLID Principles?

The SOLID principles are a set of guidelines that can help developers create more maintainable, flexible, reusable and scalable software applications. The principles were introduced by Robert C. Martin in his 2000 paper, "Design Principles and Design Patterns," and the acronym SOLID was coined by Michael Feathers.

The SOLID principles are as follows:

  • Single Responsibility Principle (SRP): A class should have only one reason to change.
  • Open/Closed Principle (OCP): Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification.
  • Liskov Substitution Principle (LSP): Subtypes must be substitutable for their base types.
  • Interface Segregation Principle (ISP): A client should not be forced to depend on methods it does not use.
  • Dependency Inversion Principle (DIP): High-level modules should not depend on low-level modules. Both should depend on abstractions.

Examples

This repository contains code examples that demonstrate each of the SOLID principles. Each example is located in a separate directory and includes a README file that explains the principle and example and how it relates to the SOLID principle it demonstrates.

Contributing

Contributions are welcome! If you have an example that demonstrates one of the SOLID principles that is not included in this repository, or if you find an error or improvement in an existing example, please submit a pull request.

About


Languages

Language:Dart 100.0%