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



Download 7,21 Mb.
Pdf ko'rish
bet104/343
Sana17.11.2022
Hajmi7,21 Mb.
#867526
1   ...   100   101   102   103   104   105   106   107   ...   343
Bog'liq
Eric Evans 2003 - Domain-Driven Design - Tackling Complexity in the Heart of Software

Figure 6.22. A 
REPOSITORY
 uses a 
FACTORY
 to reconstitute a preexisting
object.
This clear separation also helps by unloading all responsibility for persistence from the 
FACTORIES
.

FACTORY'S
job is to instantiate a potentially complex object from data. If the product is a new
object, the client will know this and can add it to the 
REPOSITORY
, which will encapsulate the
storage of the object in the database.
Figure 6.23. A client uses a 
REPOSITORY
 to store a new object.


One other case that drives people to combine 
FACTORY
and 
REPOSITORY
is the desire for "find or
create" functionality, in which a client can describe an object it wants and, if no such object is
found, will be given a newly created one. This function should be avoided. It is a minor
convenience at best. A lot of cases in which it seems useful go away when 
ENTITIES
and 
VALUE
OBJECTS
are distinguished. A client that wants a 
VALUE OBJECT
can go straight to a 
FACTORY
and ask
for a new one. Usually, the distinction between a new object and an existing object is important in
the domain, and a framework that transparently combines them will actually muddle the situation.
[ Team LiB ]


[ Team LiB ]
Designing Objects for Relational Databases
The most common nonobject component of primarily object-oriented software systems is the
relational database. This reality presents the usual problems of a mixture of paradigms (see
Chapter 5). But the database is more intimately related to the object model than are most other
components. The database is not just interacting with the objects; it is storing the persistent form
of the data that makes up the objects themselves. A good deal has been written about the
technical challenges of mapping objects to relational tables and effectively storing and retrieving
them. A recent discussion can be found in Fowler 2002. There are reasonably refined tools for
creating and managing mappings between the two. Apart from the technical concerns, this
mismatch can have a significant impact on the object model.
There are three common cases:
The database is primarily a repository for the objects.

Download 7,21 Mb.

Do'stlaringiz bilan baham:
1   ...   100   101   102   103   104   105   106   107   ...   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