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


Figure 11.8. The class diagram of the basic posting rule



Download 7,21 Mb.
Pdf ko'rish
bet206/343
Sana17.11.2022
Hajmi7,21 Mb.
#867526
1   ...   202   203   204   205   206   207   208   209   ...   343
Bog'liq
Eric Evans 2003 - Domain-Driven Design - Tackling Complexity in the Heart of Software

Figure 11.8. The class diagram of the basic posting rule
A posting rule is triggered by a new 
Entry
in its "input" account. It then derives a new 
Entry
(based on its own calculation 
Method
) and inserts the new 
Entry
into its "output" 
Account
.
In a payroll system, an 
Entry
in a salary 
Account 
might trigger a 
Posting Rule
that would
calculate a 30 percent estimated income tax and insert it as an 
Entry
in the tax with-holding
Account
.
Executing Posting Rules
The 
Posting Rule
has established the conceptual dependency between 
Accounts
, but if the
pattern stopped there, it could be difficult to follow. One of the trickiest parts of dependency
designs is the timing and control of updates. Fowler discusses three options.
"Eager firing" is the most obvious, but typically the least practical. Whenever an 
Entry
is inserted into an 
Account
, it immediately triggers the 
Posting Rules
and all updates
are made immediately.
1.
"
Account
-based firing" allows processing to be deferred. At some point, a message is
sent to an 
Account
and it triggers its 
Posting Rules
to process all 
Entries_inserted_since_its_last_firing._2._3.__2.'>Entries
inserted
since its last firing.
2.
3.


2.
Finally, "
Posting-Rule
-based firing" is initiated by an external agent, which tells the
Posting Rule
to fire. The 
Posting Rule 
is responsible for looking up all 
Entries
made
to its input 
Accounts
since the last time it fired.
Although firing modes can be mixed in a system, each particular set of rules needs to
have one clearly defined point of initiation and responsibility for identifying input
Account Entries
. The addition of the three firing modes to the 
UBIQUITOUS LANGUAGE
is
as important to the success of the pattern as the model object definitions themselves. It
eliminates ambiguity and guides decision making directly to a clearly defined set of
choices. These modes identify an easily overlooked challenge and provide vocabulary to
support clear discussion.

Download 7,21 Mb.

Do'stlaringiz bilan baham:
1   ...   202   203   204   205   206   207   208   209   ...   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