- Mastering Microservices with Java
- Sourabh Sharma
- 346字
- 2021-07-02 13:03:37
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.
- C++面向?qū)ο蟪绦蛟O(shè)計(jì)(微課版)
- Developing Middleware in Java EE 8
- Architecting the Industrial Internet
- Learn React with TypeScript 3
- H5頁面設(shè)計(jì):Mugeda版(微課版)
- Python High Performance Programming
- App Inventor創(chuàng)意趣味編程進(jìn)階
- Angular應(yīng)用程序開發(fā)指南
- 自學(xué)Python:編程基礎(chǔ)、科學(xué)計(jì)算及數(shù)據(jù)分析(第2版)
- 虛擬現(xiàn)實(shí)建模與編程(SketchUp+OSG開發(fā)技術(shù))
- Leaflet.js Essentials
- 軟件測試項(xiàng)目實(shí)戰(zhàn)之功能測試篇
- Python量子計(jì)算實(shí)踐:基于Qiskit和IBM Quantum Experience平臺(tái)
- Hands-On GUI Application Development in Go
- Natural Language Processing with Java Cookbook