Skip to content

Commit

Permalink
add new chapter about SRP and shallow modules
Browse files Browse the repository at this point in the history
  • Loading branch information
zakirullin committed Sep 22, 2024
1 parent 18accd2 commit dff1b39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ A modern implementation of this interface has **hundreds of thousands of lines o
If you think we are rooting for bloated God objects with too many responsibilities, you got it wrong.

## Shallow modules and SRP
All too often, engineers end up creating lots of shallow modules, following some vague "a module should be responsible for one, and only one, thing" principle. What is this fuzzy one thing? Instantiating an object is one thing, right? How about saving a user? We introduce things like `MetricsProviderFactoryFactory` and `UserSaver` classes, and all they do is one tiny thing. The names and interfaces of such classes tend to be more mentally taxing than their entire implementations, what kind of abstraction is that? That's all very wrong.
All too often, engineers end up creating lots of shallow modules, following some vague "a module should be responsible for one, and only one, thing" principle. What is this fuzzy one thing? Instantiating an object is one thing, right? How about saving a user? We introduce things like `MetricsProviderFactoryFactory` and `UserSaver` classes, and all they do is one tiny thing. The names and interfaces of such classes tend to be more mentally taxing than their entire implementations, what kind of abstraction is that? Something went wrong.

We make changes to our systems to satisfy our stackeholders and users. We are responsible to them.

Expand Down

0 comments on commit dff1b39

Please sign in to comment.