Skip to content

README

Loading...

Live system. This version passed every check before it shipped.

Blog

Steven StoutBlogOct 19, 2026 · 2 min read

SOLID in five real files

All five SOLID principles in five small files of The Shed, a .NET 10 file browser: the rule in plain words, then the real file that follows it.

Title slide: SOLID, shown in real .NET code, five rules each shown on a real file from The Shed.

01The full post

Steven Stout

Staff .NET Engineer | AI-Assisted Development with Quality Gates | 12 Years Full Stack .NET, 7 Fully Remote

· first posted on LinkedIn · 2 min read

You can see all five SOLID principles in five small files.

SOLID is five rules that keep code easy to change. The names are hard to recite. The habits are easy to spot once you know where to look.

Here they are in The Shed, a small file browser I built in .NET 10 for people learning the stack. Each principle gets the rule in plain words, then the real file that follows it. The slides below walk the same five, one per principle.

1. Single Responsibility (SRP)

A class should have one job and one reason to change.

In The Shed: FileBrowser runs the search. NamePattern decides what matches. SearchMatches decides when to stop. Three jobs, three classes.

2. Open/Closed (OCP)

Open for extension, closed for modification. Add new behavior without rewriting what already works.

In The Shed: a new kind of refusal is one new line in ApiRefusalException. No existing class changes.

3. Liskov Substitution (LSP)

Anything that implements an interface must be swappable for any other implementation without breaking the caller.

In The Shed: the tests swap FakeStore in for PhysicalFileStore. FileBrowser never notices.

4. Interface Segregation (ISP)

No class should depend on methods it does not use. Small, specific interfaces beat one big general one.

In The Shed: IFileStore has ten methods, every one a file or folder operation. No web, no config, no logging leaks in.

5. Dependency Inversion (DIP)

High-level code should depend on abstractions, not on concrete implementations.

In The Shed: FileBrowser takes IFileStore, the interface. The one line that knows about the real disk is in the wiring.

Why it matters

  • Lower coupling → a change stays where you made it
  • Higher testability → each piece tests on its own
  • Easier maintenance → clear ownership, fewer bugs, fewer merge conflicts

A simple way to remember

  • One job per class → S
  • Add a line, not a rewrite → O
  • Swap the real for the fake → L
  • Ask for only what you need → I
  • Depend on the interface → D

The names matter less than the habit. Code can follow all five before you can recite them.

Which of the five do you catch yourself breaking most often?

References

The slides (7)

5 reads on TheYard0 this week

Steven Stout

Steven Stout

Staff .NET engineer · Remote

I have spent twelve years building full stack software in C#, SQL Server, React and Azure.

About StevenCheck my work

02What has to work, where is it today, and what does success look like?

Book 20 minutes opens an email to me with those three questions in it, and I answer with a time.

Book 20 minutes

Your email app should have opened with this message. If it did not, copy it and send it from any mailbox.

Or message me on LinkedIn