Member-only story

Single Responsibility Principle — It Isn’t What You Think It Is

Phillip Johnson
CodeX
Published in
7 min readApr 2, 2022
Photo by Ross Findon on Unsplash

Introduction

The Single Responsibility Principle is the most misunderstood of all the SOLID Principles. I’ve certainly gotten it wrong in the past and almost everybody I talk to gets it wrong in the same way. How can that be when it seems like the simplest principle? Granted, not all people get it wrong, if you got it right, well done! You’re in the minority. In this article we’ll look at what most people think it is, what it actually is, and cover some Domain Driven Design (DDD) and Bounded Contexts along the way.

SOLID Principles

Let’s start with a quick introduction to the SOLID Principles for anybody who isn’t already familiar with them. In 2000, Robert C. Martin, or Uncle Bob, wrote the article Design Principles and Design Patterns which compiled several existing software principles and patterns that Martin found, in his experience, worked well together. Martin didn’t necessarily invent anything new here, but he probably saved readers of the article months, or years, of reading and studying the sources that these principles and patterns came from as well as sharing his experience and thoughts on effective software development.

--

--

CodeX
CodeX

Published in CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Phillip Johnson
Phillip Johnson

Written by Phillip Johnson

Over 20 years experience in software engineering, mostly in leadership positions. Passionate about software craftsmanship.

Responses (4)