- 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.
- MySQL數據庫管理實戰
- 解構產品經理:互聯網產品策劃入門寶典
- C# 2012程序設計實踐教程 (清華電腦學堂)
- Rust實戰
- SQL Server 2012數據庫技術及應用(微課版·第5版)
- MongoDB for Java Developers
- Spring Boot+Spring Cloud+Vue+Element項目實戰:手把手教你開發權限管理系統
- PHP+MySQL+Dreamweaver動態網站開發實例教程
- GameMaker Programming By Example
- D3.js 4.x Data Visualization(Third Edition)
- Python機器學習:預測分析核心算法
- Java程序設計案例教程
- Odoo 10 Implementation Cookbook
- Visual Basic程序設計習題與上機實踐
- 自學Python:編程基礎、科學計算及數據分析(第2版)