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



Download 7,21 Mb.
Pdf ko'rish
bet189/343
Sana17.11.2022
Hajmi7,21 Mb.
#867526
1   ...   185   186   187   188   189   190   191   192   ...   343
Bog'liq
Eric Evans 2003 - Domain-Driven Design - Tackling Complexity in the Heart of Software

S
PECIFICATION
 Stack Content for "Cheap Container"
Top
AndSpecificationOperator (F
LY
W
EIGHT
)
NotSpecificationOperator (F
LY
W
EIGHT
)
Armored
NotSpecificationOperator
Ventilated
When you want to test a candidate, you have to interpret this structure, which can be done by
popping off each element, then evaluating it or popping off the next as required by an operator.
You would end up with this:
and(not(armored), not(ventilated))
This design has pros (
+
) and cons (

):
+
Low object count
+
Efficient use of memory

Requires more sophisticated developers
You have to find an implementation with trade-offs that work for your circumstances. The same
pattern and model can underlie very different implementations.
Subsumption
This final feature is not usually needed and can be difficult to implement, but every now and then
it solves a really hard problem. It also elucidates the meaning of a 
SPECIFICATION
.
Consider again the chemical warehouse packer from the example on page 235. Recall that each
Chemical
had a 
Container Specification,
and the 
Packer
SERVICE
guaranteed that all these
would be satisfied when 
Drums
are assigned to 
Containers
. All is well... until someone changes
the regulations.
Every few months a new set of rules is issued, and our users would like to be able to produce a list
of the chemical types that now have more stringent requirements.
Of course, we could give a partial answer (and one the users probably also want) by running a
validation of each 
Drum
in the inventory, with the new 
SPECIFICATIONS
in place, and finding all
those that no longer meet the 
SPEC
. This would tell the users which 
Drums 
in the existing
inventory they need to move.
But what they 
asked for
was a list of chemicals whose handling has become more stringent.
Perhaps there are none in-house right now, or perhaps they just happened to be packed into a
more stringent container. In either case, the report just described would not list them.
Let's introduce a new operation for directly comparing two 
SPECIFICATIONS
.
boolean subsumes(Specification other);
A more stringent 
SPEC
subsumes a less stringent one. It could take its place without any previous


requirement being neglected.

Download 7,21 Mb.

Do'stlaringiz bilan baham:
1   ...   185   186   187   188   189   190   191   192   ...   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