原书出处
Domain-Driven Design Tackling Complexity in the Heart of Software
123 原书第15章|Segregated Core
simple and direct as possible. Now it becomes easy to pull the Customer out of the CORE altogether.
And what about pulling Customer out, anyway? The focus is on fulfilling the Customer's requirements, so at first Customer seems to belong in the CORE. Yet the interactions during delivery do not usually need to involve the Customer class now that the Customer Agreement is available directly. And the basic model of a Customer is pretty generic. A strong argument could be made for Leg to remain in the CORE. I tend to be minimalist in the CORE, and the Leg has tighter cohesion with Transport Schedule, Routing Service, and Location, none of which needed to be in the CORE. But if a lot of the stories I wanted to tell about this model involved Legs, I'd move it into the Delivery package and suffer the awkwardness of its separation from those other classes.
In this example, all the class definitions are the same as before, but often distillation requires
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Domain-Driven Design Tackling Complexity in the Heart of Software/_epub-src/0321125215_ch15lev1sec7.html
EPUB SHA-256:3e81897e8809ae8135b32e0563f9858b3020c5f5128531655f6d8e3a21c679ce