Clean Architecture


Chapter 13 Component Cohesion



Download 6,37 Mb.
Pdf ko'rish
bet69/259
Sana26.02.2022
Hajmi6,37 Mb.
#465587
1   ...   65   66   67   68   69   70   71   72   ...   259
Bog'liq
Clean Architecture A Craftsman’s Guide to Software Structure and Design by Robert C. Martin (z-lib.org)

Chapter 13 Component Cohesion
108
component—but that still doesn’t weaken the dependency. The 
using
component still depends on the 
used
component. 
Because of that dependency, every time the 
used
component is changed, the 
using
component will likely need corresponding changes. Even if no changes 
are necessary to the 
using
component, it will likely still need to be 
recompiled, revalidated, and redeployed. This is true even if the 
using
component doesn’t care about the change made in the 
used
component. 
Thus when we depend on a component, we want to make sure we depend on 
every class in that component. Put another way, we want to make sure that 
the classes that we put into a component are inseparable—that it is 
impossible to depend on some and not on the others. Otherwise, we will be 
redeploying more components than is necessary, and wasting significant 
effort. 
Therefore the CRP tells us more about which classes 
shouldn’t
be together 
than about which classes 
should
be together. The CRP says that classes that 
are not tightly bound to each other should not be in the same component. 
R e l ati o n to I S P
The CRP is the generic version of the ISP. The ISP advises us not to depend 
on classes that have methods we don’t use. The CRP advises us not to depend 
on components that have classes we don’t use. 
All of this advice can be reduced to a single sound bite:
Don’t depend on things you don’t need.
Th e Te n s i o n D i ag r a m fo r C o m p o n e n t C o h e s i o n
You may have already realized that the three cohesion principles tend to fight 
each other. The REP and CCP are 
inclusive
principles: Both tend to make 
www.EBooksWorld.ir



Download 6,37 Mb.

Do'stlaringiz bilan baham:
1   ...   65   66   67   68   69   70   71   72   ...   259




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