Self-containment pattern
In simple words, self-containment means that an application or service should be self-sufficient or able to work as a standalone entity without depending on any other entity. Let's say we have a service for EmployeeData that tackles general employee data handling and another service for EmployeeSalary. Let's say we have given responsibility for maintaining database connections to the EmployeeData service. So, every time the EmployeeSalary service needs a database handled, it calls the EmplyeeData service's getDatabaseHandle method. This adds an unwanted dependency, which means that, unless the EmployeeData service is up and working fine, our EmployeeSalary service will not function properly. So, it is logical that ...
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