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


Figure 6.9. Over-cautious locking is interfering with people's work



Download 7,21 Mb.
Pdf ko'rish
bet87/343
Sana17.11.2022
Hajmi7,21 Mb.
#867526
1   ...   83   84   85   86   87   88   89   90   ...   343
Bog'liq
Eric Evans 2003 - Domain-Driven Design - Tackling Complexity in the Heart of Software

Figure 6.9. Over-cautious locking is interfering with people's work.
The inconvenience is mounting, because there is a lot of contention for the instruments (the
"parts"). And then:
Figure 6.10. Deadlock
Those three will be waiting a while.
At this point we can begin to improve the model by incorporating the following knowledge of the
1.


business:
Parts are used in many POs (high contention).
1.
There are fewer changes to parts than there are to POs.
2.
Changes to part prices do not necessarily propagate to existing POs. It depends on the time
of a price change relative to the status of the PO.
3.
Point 3 is particularly obvious when we consider archived POs that have already been delivered.
They should, of course, show the prices as of the time they were filled, rather than current prices.
Figure 6.11. Price is copied into Line Item. A
GGREGATE
 invariant can now
be enforced.
An implementation consistent with this model would guarantee the invariant relating PO and its
items, while changes to the price of a part would not have to immediately affect the items that
reference it. Broader consistency rules could be addressed in other ways. For example, the system
could present a queue of items with outdated prices to the users each day, so they could update or
exempt each one. But this is not an invariant that must be enforced at all times. By making the
dependency of line items on parts looser, we avoid contention and reflect the realities of the
business better. At the same time, tightening the relationship of the PO and its line items
guarantees that an important business rule will be followed.
The 
AGGREGATE
imposes an ownership of the PO and its items that is consistent with business
practice. The creation and deletion of a PO and items are naturally tied together, while the creation
and deletion of parts is independent.
AGGREGATES
mark off the scope within which invariants have to be maintained at every stage of
the life cycle. The following patterns
FACTORIES
and 
REPOSITORIES
, operate on 
AGGREGATES
,
encapsulating the complexity of specific life cycle transitions. . . .


[ Team LiB ]


[ Team LiB ]

Download 7,21 Mb.

Do'stlaringiz bilan baham:
1   ...   83   84   85   86   87   88   89   90   ...   343




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
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