Skip to content

A simple but effective demonstration of how to adhere to SOLID principles and write sustainable and testable code

Notifications You must be signed in to change notification settings

AlbertoDiana/solid-playground

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SOLID Playground

The way to design and write understandable, flexible, and maintainable code is rough. SOLID is the best way to reduce complexity and save ourselves a lot of headaches as our applications grow in size and functionalities.

The journey will start from the dark side of Pasta coding to move into the Eden of the SOLID principles applied to an existing codebase.

  • Spaghetti coding: a codebase that violates several SOLID principles
  • Step by step introduction of the SOLID principles
  • Full adherence to SOLID principles on the whole codebase

Requirements

  • Dotnet SDK 6.0

To install SDK, please refer to official microsoft download page

How to run

Open a terminal on current folder. To run a project use command: dotnet run --project <project folder>/<project name>.csproj

ex. dotnet run --project SolidPlayground-D/SolidPlayground-D.csproj

To stop exectution press ctrl + c with focus on terminal window.

Structure

SolidPlayground solution is composed by many projects. They can be split into categories:

  • dependencies to centralize some operations and to provide a mocked messaging library:
    • Core
    • Infrastructure
    • MessagesFramework
  • proposed implementations to see how a codebase can improve when applying SOLID principles (starting from messy SpaghettiCode project):
    • SolidPlayground-SpaghettiCode
    • SolidPlayground-S
    • SolidPlayground-O
    • SolidPlayground-L
    • SolidPlayground-I
    • SolidPlayground-D
    • SolidPlayground-SOLID
  • a playground project to experiment with the code:
    • SolidPlayground

Contributing

See Contributing for information, guidelines, and making pull requests to contribute to this repository.

About

A simple but effective demonstration of how to adhere to SOLID principles and write sustainable and testable code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%