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


Example Full Circle: Organization Chart Reabsorbs Its M



Download 7,21 Mb.
Pdf ko'rish
bet290/343
Sana17.11.2022
Hajmi7,21 Mb.
#867526
1   ...   286   287   288   289   290   291   292   293   ...   343
Bog'liq
Eric Evans 2003 - Domain-Driven Design - Tackling Complexity in the Heart of Software

Example
Full Circle: Organization Chart Reabsorbs Its M
ECHANISM
Actually, a year after we completed the organization model in the previous example, other
developers redesigned it to eliminate the separation of the graph framework. They felt the
increased object count and the complication of separating the 
MECHANISM
into a separate package
were not warranted. Instead, they added node behavior to the parent class of the organizational
ENTITIES
. Still, they retained the declarative public interface of the organization model. They even
kept the 
MECHANISM
encapsulated, within the organizational 
ENTITIES
.
These full circles are common, but they do not return to their starting point. The end result is
usually a deeper model that more clearly differentiates facts, goals, and 
MECHANISMS
. Pragmatic
refactoring retains the important virtues of the intermediate stages while shedding the unneeded
complications.
Distilling to a Declarative Style
Declarative design and "declarative style" is a topic of Chapter 10, but that design style deserves
special mention in this chapter on strategic distillation. The value of distillation is being able to see
what you are doing: cutting to the essence without being distracted by irrelevant detail. Important
parts of the 
CORE DOMAIN
may be able to follow a declarative style, when the supporting design
provides an economical language for expressing the concepts and rules of the 
CORE
while
encapsulating the means of computing or enforcing them.
C
OHESIVE MECHANISMS
are by far most useful when they provide access through an 
INTENTION-
REVEALING INTERFACE
, with conceptually coherent 
ASSERTIONS
and 
SIDE-EFFECT-FREE FUNCTIONS
.
M
ECHANISMS
and supple designs allow the 
CORE DOMAIN
to make meaningful statements rather
than calling obscure functions. But an exceptional payoff comes when part of the 
CORE DOMAIN
itself breaks through to a deep model and starts to function as a language that can express the
most important application scenarios flexibly and concisely.
A deep model often comes with a corresponding supple design. When a supple design reaches
maturity, it provides an easily understood set of elements that can be combined unambiguously to
accomplish complex tasks or express complex information, just as words are combined into
sentences. At that point, client code takes on a declarative style and can be much more distilled.


Factoring out 
GENERIC SUBDOMAINS
reduces clutter, and 
COHESIVE MECHANISMS
serve to encapsulate
complex operations. This leaves behind a more focused model, with fewer distractions that add no
particular value to the way users conduct their activities. But you are unlikely ever to find good
homes for 
everything
in the domain model that is not 
CORE
. The 
SEGREGATED CORE
takes a direct
approach to structurally marking off the 
CORE DOMAIN
....
[ Team LiB ]


[ Team LiB ]

Download 7,21 Mb.

Do'stlaringiz bilan baham:
1   ...   286   287   288   289   290   291   292   293   ...   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