Domain-Driven Design: Tackling Complexity in the Heart of Software


Example Shipment Routes Made of Routes



Download 7,21 Mb.
Pdf ko'rish
bet216/343
Sana17.11.2022
Hajmi7,21 Mb.
#867526
1   ...   212   213   214   215   216   217   218   219   ...   343
Bog'liq
Eric Evans 2003 - Domain-Driven Design - Tackling Complexity in the Heart of Software

Example
Shipment Routes Made of Routes
A complete cargo shipment route is complicated. First the container must be trucked to a railhead,
then carried to a port, then transported on a ship to another port, possibly transferred to other
ships, and finally transported by ground on the other end.
Figure 12.3. A schematic of a "route" made up of "legs"
An application development team has created an object model to express these arbitrarily long
strings of legs that assemble into a route.
Figure 12.4. A class diagram of a Route made up of Legs


Using this model, the developers are able to create 
Route
objects based on booking requests.
They are able to process the 
Legs
into the operational plan for the step-by-step handling of the
cargo. Then they discover something.
The developers had always thought of a route as an arbitrary, un-differentiated string of legs.
Figure 12.5. The developers' conception of a route
It turns out the domain experts see the route as a sequence of five logical segments.
Figure 12.6. The business experts' conception of a route
Among other things, these subroutes may be planned at different times by different people, so
they have to be viewed as distinct. And on closer inspection, the "door legs" are quite different


from the other legs, involving locally hired trucks or even customer haulage, in contrast to the
elaborately scheduled rail and ship transports.
An object model reflecting all these distinctions starts to get complicated.
Figure 12.7. The elaborated class diagram of Route
Structurally the model isn't so bad, but the uniformity of processing the operational plan is lost, so
the code, or even a description of behavior, becomes much more complicated. Other complications
begin to surface, too. Any traversal of a route involves multiple collections of different types of
objects.
Enter 
COMPOSITE
. It would be nice, for certain clients, to treat the different levels in this construct
uniformly, as routes made up of routes. Conceptually this view is sound. Every level of 
Route
is a
movement of a container from one point to another, all the way down to an individual leg. (See
Figure 12.8.)

Download 7,21 Mb.

Do'stlaringiz bilan baham:
1   ...   212   213   214   215   216   217   218   219   ...   343




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2025
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish