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


part of the input parameters in a FACTORY reconstituting a stored object



Download 7,21 Mb.
Pdf ko'rish
bet96/343
Sana17.11.2022
Hajmi7,21 Mb.
#867526
1   ...   92   93   94   95   96   97   98   99   ...   343
Bog'liq
Eric Evans 2003 - Domain-Driven Design - Tackling Complexity in the Heart of Software


part of the input parameters in a FACTORY reconstituting a stored object.
1.

FACTORY
 reconstituting an object will handle violation of an invariant differently
. During
creation of a new object, a FACTORY should simply balk when an invariant isn't met, but a
more flexible response may be necessary in reconstitution. If an object already exists
somewhere in the system (such as in the database), this fact cannot be ignored. Yet we also
can't ignore the rule violation. There has to be some strategy for repairing such
inconsistencies, which can make reconstitution more challenging than the creation of new
objects.
2.
Figures 6.16 and 6.17 (on the next page) show two kinds of reconstitution. Object-mapping
technologies may provide some or all of these services in the case of database reconstitution,
which is convenient. Whenever there is exposed complexity in reconstituting an object from
another medium, the 
FACTORY
is a good option.
Figure 6.16. Reconstituting an 
ENTITY
 retrieved from a relational


database
Figure 6.17. Reconstituting an 
ENTITY
 transmitted as XML
To sum up, the access points for creation of instances must be identified, and their scope must be
defined explicitly. They may simply be constructors, but often there is a need for a more abstract
or elaborate instance creation mechanism. This need introduces new constructs into the design:
FACTORIES
. F
ACTORIES
usually do not express any part of the model, yet they are a part of the
domain design that helps keep the model-expressing objects sharp.

FACTORY
encapsulates the life cycle transitions of creation and reconstitution. Another transition
that exposes technical complexity that can swamp the domain design is the transition to and from
storage. This transition is the responsibility of another domain design construct, the 
REPOSITORY
.
[ Team LiB ]


[ Team LiB ]

Download 7,21 Mb.

Do'stlaringiz bilan baham:
1   ...   92   93   94   95   96   97   98   99   ...   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