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


Loan amount and subtract it from the  Loan's



Download 7,21 Mb.
Pdf ko'rish
bet198/343
Sana17.11.2022
Hajmi7,21 Mb.
#867526
1   ...   194   195   196   197   198   199   200   201   ...   343
Bog'liq
Eric Evans 2003 - Domain-Driven Design - Tackling Complexity in the Heart of Software

Loan
amount and subtract it from the 
Loan's
actual shares:
SharePie originalAgreement =
aFacility.getShares().prorated(aLoan.getAmount());
SharePie actual = aLoan.getShares();
SharePie deviation = actual.minus(originalAgreement);
Certain characteristics of the 
Share Pie
design make for this easy recombination and
communication in the code.
Complex logic is encapsulated in specialized 
VALUE OBJECTS
 with 
SIDE-EFFECT-FREE FUNCTIONS
.
Most complex logic has been encapsulated in these immutable objects. Because 
Share Pies
are 
VALUE OBJECTS
, the math operations can create new instances, which we can use freely to
replace outdated instances.
None of the 
Share Pie
methods causes any change to any existing object. This allows us to
use 
plus()

minus()
, and 
pro-rated()
freely in intermediate calculations, combining them,
expecting them to do what their names suggest, and nothing more. It also allows us to build
analytical features based on the same methods. (Before, they could be called only when an
actual distribution was made, because the data would change after each call.)
State-modifying operations are simple and characterized with 
ASSERTIONS
. The high-level
abstractions of Shares Math allow invariants of transactions to be written concisely in a
declarative style. For example, the deviation is the actual pie minus the 
Loan 
amount
prorated based on the 
Facility's Share Pie
.
Model concepts are decoupled; operations entangle a minimum of other types
. Some
methods on 
Share Pie
exhibit 
CLOSURE OF OPERATIONS
(the methods to add or subtract are
closed under 

Download 7,21 Mb.

Do'stlaringiz bilan baham:
1   ...   194   195   196   197   198   199   200   201   ...   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