← 返回卡片

原书出处

Domain-Driven Design Tackling Complexity in the Heart of Software

59 原书第07章|Introducing a New Feature: Allocation Checking

核验版本的摘录快照 · 导入于 2026-11-14T03:12:56.393Z

h a count, rather than a collection of instances.) There are still a few problems with this design.

We have given the Booking Application the job of applying this rule: "A Cargo is accepted if the space allocated for its Enterprise Segment is greater than the quantity already booked plus the size of the new Cargo." Enforcing a business rule is domain responsibility and shouldn't be performed in the application layer. It isn't clear how the Booking Application derives the Enterprise Segment. Both of these responsibilities seem to belong to the Allocation Checker.

Changing its interface can separate these two SERVICES and make the interaction clear and explicit.

此预览只包含定位所需的摘录和上下文。

原书定位详情

来源:a19c7933-4eda-4176-aebd-30fe7e1ad292

正文位置:extracted/Domain-Driven Design Tackling Complexity in the Heart of Software/_epub-src/0321125215_ch07lev1sec11.html

EPUB SHA-256:3e81897e8809ae8135b32e0563f9858b3020c5f5128531655f6d8e3a21c679ce