Single responsibility pattern
Also known as the simple-component pattern or microservices pattern, the single-responsibility pattern is kind of an extension to the single-responsibility principle for OOP. We already discussed the single-responsibility principle in this book in the initial chapters. At a basic level, when applied to object-oriented programming, the single-responsibility principle states that a class should have only one reason to change. Taking that definition further to an architecture level, we broaden the scope of this principle to components or services. So now we are defining our single-responsibility pattern to mean that a component or service should be responsible for only a single task.
One needs to divide the application ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access