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


Chapter Six. The Life Cycle of a Domain



Download 7,21 Mb.
Pdf ko'rish
bet82/343
Sana17.11.2022
Hajmi7,21 Mb.
#867526
1   ...   78   79   80   81   82   83   84   85   ...   343
Bog'liq
Eric Evans 2003 - Domain-Driven Design - Tackling Complexity in the Heart of Software

Chapter Six. The Life Cycle of a Domain
Object
Every object has a life cycle. An object is born, it likely goes through various states, and it
eventually dies—being either archived or deleted. Of course, many of these are simple, transient
objects, created with an easy call to their constructor, used in some computation, and then
abandoned to the garbage collector. There is no need to complicate such objects. But other
objects have longer lives, not all of which are spent in active memory. They have complex
interdependencies with other objects. They go through changes of state to which invariants apply.
Managing these objects presents challenges that can easily derail an attempt at 
MODEL-DRIVEN
DESIGN
.
Figure 6.1. The life cycle of a domain object
The challenges fall into two categories.
Maintaining integrity throughout the life cycle
1.
Preventing the model from getting swamped by the complexity of managing the life cycle
2.
This chapter will address these issues through three patterns. First, 
AGGREGATES
tighten up the
model itself by defining clear ownership and boundaries, avoiding a chaotic, tangled web of
objects. This pattern is crucial to maintaining integrity in all phases of the life cycle.
Next, the focus turns to the beginning of the life cycle, using 
FACTORIES
to create and reconstitute
complex objects and 
AGGREGATES
, keeping their internal structure encapsulated. Finally,
REPOSITORIES
address the middle and end of the life cycle, providing the means of finding and


retrieving persistent objects while encapsulating the immense infrastructure involved.
Although 
REPOSITORIES
and 
FACTORIES
do not themselves come from the domain, they have
meaningful roles in the domain design. These constructs complete the 
MODEL-DRIVEN DESIGN
by
giving us accessible handles on the model objects.
Modeling 
AGGREGATES
and adding 
FACTORIES
and 
REPOSITORIES
to the design gives us the ability to
manipulate the model objects systematically and in meaningful units throughout their life cycle.
AGGREGATES
mark off the scope within which invariants have to be maintained at every stage of
the life cycle. F
ACTORIES
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   ...   78   79   80   81   82   83   84   85   ...   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