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

Bounded context

When you have different sub-models, it is difficult to maintain the code when all sub-models are combined. You need to have a small model that can be assigned to a single team. You might need to collect the related elements and group them. Context keeps and maintains the meaning of the domain term defined for its respective sub-model by applying this set of conditions. Domain models are divided into sub-models, and bounded context distinguishes the context of one sub-domain from the context of another sub-domain.

These domain terms define the scope of the model that creates the boundaries of the context.

Bounded context seems very similar to the module that you learned about in the previous section. In fact, the module is part of the bounded context that defines the logical frame where a sub-model takes place and is developed, whereas the module organizes the elements of the domain model, and is visible in the design document and the code. This also helps to isolate the models and the language from one model to another to avoid ambiguity.

Now, as a designer, you need to keep each sub-model well-defined and consistent. In this way, you can refactor each model independently without affecting the other sub-models. This gives the software designer the flexibility to refine and improve it at any point in time.

Now, let's examine the table reservation example we've been using. When you started designing the system, you would have seen that the guest would visit the application, and would request a table reservation at a selected restaurant, date, and time. Then, there is the backend system that informs the restaurant about the booking information, and similarly, the restaurant would keep their system updated with regard to table bookings, given that tables can also be booked by the restaurant themselves. So, when you look at the system's finer points, you can see two domain models:

  • The online table-reservation system
  • The offline restaurant-management system

Both have their own bounded context and you need to make sure that the interface between them works okay.

主站蜘蛛池模板: 甘洛县| 松阳县| 固阳县| 全南县| 奉贤区| 磐安县| 安平县| 池州市| 确山县| 新邵县| 竹北市| 克拉玛依市| 井冈山市| 徐水县| 怀宁县| 东源县| 靖宇县| 申扎县| 会同县| 武宣县| 伊宁县| 中宁县| 大丰市| 繁昌县| 泸溪县| 隆昌县| 竹山县| 沙河市| 同仁县| 格尔木市| 鹤山市| 永新县| 巴马| 句容市| 庆元县| 潞城市| 九寨沟县| 得荣县| 白玉县| 遂溪县| 沧源|