官术网_书友最值得收藏!

  • Java EE 8 and Angular
  • Prashant Padmanabhan
  • 185字
  • 2021-07-02 19:22:38

Follow domain-driven design

Focus on the responsibility that the microservice is trying to meet. The scope of the service is more important than the lines of code used to build it. Teams would usually sit together and build an understanding of the domain from the domain experts. Once the domain is understood, then it is modeled as domain objects, which can be further grouped as sub-domains. In a monolith, the entire domain model is within a single application, but the microservice architecture would lead your domains to be used within different business contexts.

Bounded Contexts is a term used in DDD, which maps the domain entities within the context of its usage. A payment microservice might require a domain entity such as User, to be used for billing purposes, and thus the User entity may need to have payment details associated with it. But if the same domain entity is used in a notification service, then the payment information is an additional detail, which shouldn't get leaked into this service.

The idea of a bounded context is further explained in the section on Single Responsibility.

主站蜘蛛池模板: 永清县| 旌德县| 阿拉善左旗| 潼关县| 鄂尔多斯市| 巴楚县| 育儿| 浑源县| 都兰县| 渭南市| 上虞市| 新巴尔虎左旗| 区。| 铅山县| 综艺| 新密市| 元阳县| 全椒县| 策勒县| 辉县市| 华坪县| 固安县| 静安区| 思南县| 河北省| 兴义市| 米林县| 赞皇县| 北宁市| 富阳市| 莱芜市| 株洲市| 墨玉县| 杂多县| 兴文县| 瓮安县| 策勒县| 盐源县| 牟定县| 福清市| 依兰县|