- Spring 5.0 Microservices(Second Edition)
- Rajesh R V
- 151字
- 2021-07-02 19:44:49
Single responsibility per service
The single responsibility principle is one of the principles defined as part of the SOLID design pattern. It states that a unit should only have one responsibility.
Read more about the SOLID design pattern at http://c2.com/cgi/wiki?PrinciplesOfObjectOrientedDesign.
It implies that a unit, either a class, a function, or a service, should have only one responsibility. At no point do two units share one responsibility, or one unit perform more than one responsibility. A unit with more than one responsibility indicates tight coupling:

As shown in the preceding diagram, Customer, Product, and Order are different functions of an e-commerce application. Rather than building all of them into one application, it is better to have three different services, each responsible for exactly one business function, so that changes to one responsibility will not impair the others. In the preceding scenario, Customer, Product, and Order were treated as three independent microservices.
- ServiceNow Application Development
- Mastering RabbitMQ
- Learning Linux Binary Analysis
- 名師講壇:Java微服務架構實戰(SpringBoot+SpringCloud+Docker+RabbitMQ)
- Linux Device Drivers Development
- 軟件測試技術指南
- Learning OpenStack Networking(Neutron)(Second Edition)
- C語言程序設計
- C語言從入門到精通
- 時空數據建模及其應用
- Beginning C++ Game Programming
- Android Studio開發實戰:從零基礎到App上線 (移動開發叢書)
- Robot Framework Test Automation
- Learning Cocos2d-JS Game Development
- Splunk Essentials