ElliotOne / CSharpSOLIDPrinciples

Implementation of SOLID principles in C#

Repository from Github https://github.comElliotOne/CSharpSOLIDPrinciplesRepository from Github https://github.comElliotOne/CSharpSOLIDPrinciples

CSharp SOLID Principles

Overview

This GitHub repository contains a collection of five console application projects designed to illustrate and demonstrate the SOLID principles in C#. The SOLID principles are a set of design principles that promote maintainability, flexibility, and scalability in object-oriented software development.

The following SOLID principles are covered in separate projects within this repository:

  1. SRP (Single Responsibility Principle)
  2. OCP (Open/Closed Principle)
  3. LSP (Liskov Substitution Principle)
  4. ISP (Interface Segregation Principle)
  5. DIP (Dependency Inversion Principle)

Each project is implemented as a console application, providing a hands-on and practical approach to understanding the application of SOLID principles in C#.

Projects

1. SRP (Single Responsibility Principle)

This project focuses on demonstrating the Single Responsibility Principle, emphasizing that a class should have only one reason to change. It showcases the benefits of separating concerns and responsibilities within a class.

2. OCP (Open/Closed Principle)

The Open/Closed Principle is illustrated in this project, emphasizing that software entities (e.g., classes, modules, functions) should be open for extension but closed for modification. It demonstrates how to achieve this by using abstraction and inheritance.

3. LSP (Liskov Substitution Principle)

The Liskov Substitution Principle is explored in this project, highlighting the importance of maintaining substitutability of derived classes for their base classes. It provides examples of how to design class hierarchies that adhere to this principle.

4. ISP (Interface Segregation Principle)

This project focuses on the Interface Segregation Principle, which advocates for creating small, specific interfaces rather than large, monolithic ones. It demonstrates the benefits of this principle in terms of flexibility and adaptability.

5. DIP (Dependency Inversion Principle)

The Dependency Inversion Principle is demonstrated in this project, emphasizing the importance of depending on abstractions rather than concrete implementations. It showcases how this principle facilitates flexibility and decouples high-level modules from low-level modules.

Getting Started

To explore and run these projects, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/ElliotOne/CSharpSOLIDPrinciples.git
  2. Navigate to the specific project directory of interest (e.g., SRP, OCP, LSP, ISP, DIP).

  3. Open the project in your preferred C# integrated development environment (IDE).

  4. Build and run the console application to observe the application of the SOLID principles in action.

Feel free to experiment with the code, modify it, and explore how the SOLID principles enhance the design and maintainability of the software.

About

Implementation of SOLID principles in C#

License:MIT License


Languages

Language:C# 100.0%