- Hands-On Microservices with Kotlin
- Juan Antonio Medina Iglesias
- 161字
- 2021-06-30 19:10:40
Single responsibility
Every microservice should have responsibility over a single part of the functionality provided by the application, and that responsibility should be entirely encapsulated by the microservice. The design of the microservice should be narrowly aligned with that responsibility.
We could adopt Robert C. Martin's definition of the principle applied to OOP that said: "A class should have only one reason to change"; for this principle, we can say: a microservice should have only one reason to change.
If we realize that when we need to change a business function within our application, it modifies several microservices, or that a change cascades into non-related microservices, it is time that we reconsider how we design them.
This does not mean that we get to make microservices that do only one operation. Probably it is a good idea to have a microservice that handles the customer operations, like create, find, delete, but probably shouldn't handle operations like adding offers to a customer.
- TypeScript Blueprints
- 摩登創客:與智能手機和平板電腦共舞
- 深入淺出Java虛擬機:JVM原理與實戰
- 程序員面試算法寶典
- 網頁設計與制作教程(HTML+CSS+JavaScript)(第2版)
- INSTANT Mercurial SCM Essentials How-to
- Python Data Analysis(Second Edition)
- C語言程序設計
- 大學計算機基礎
- Python自然語言理解:自然語言理解系統開發與應用實戰
- Application Development with Parse using iOS SDK
- Python Web自動化測試設計與實現
- Greenplum構建實時數據倉庫實踐
- PostgreSQL Developer's Guide
- ASP.NET Core and Angular 2