From 32fb9cbdf150dd9b64831db6205b8ba40d1aecee Mon Sep 17 00:00:00 2001 From: Artem Zakirullin Date: Sun, 22 Sep 2024 19:22:40 +0300 Subject: [PATCH] add new chapter about SRP and shallow modules --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33c3e66..365f5b8 100644 --- a/README.md +++ b/README.md @@ -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, we 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? We introduce things like `MetricsProviderFactoryFactory`, that do that 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. +All too often, we 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? So `MetricsProviderFactoryFactory` seems to be fine. 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.