Clean Architecture


I n t ro d u c i n g t h e Sta b l e A b s t r ac ti o n s Pr i n c i pl e



Download 6,37 Mb.
Pdf ko'rish
bet82/259
Sana26.02.2022
Hajmi6,37 Mb.
#465587
1   ...   78   79   80   81   82   83   84   85   ...   259
Bog'liq
Clean Architecture A Craftsman’s Guide to Software Structure and Design by Robert C. Martin (z-lib.org)

I n t ro d u c i n g t h e Sta b l e A b s t r ac ti o n s Pr i n c i pl e
The Stable Abstractions Principle (SAP) sets up a relationship between 
stability and abstractness. On the one hand, it says that a stable component 
should also be abstract so that its stability does not prevent it from being 
extended. On the other hand, it says that an unstable component should 
be concrete since it its instability allows the concrete code within it to be 
easily changed.
www.EBooksWorld.ir


The Stable Abstractions Principle
127
Thus, if a component is to be stable, it should consist of interfaces and 
abstract classes so that it can be extended. Stable components that are 
extensible are flexible and do not overly constrain the architecture.
The SAP and the SDP combined amount to the DIP for components. This is 
true because the SDP says that dependencies should run in the direction of 
stability, and the SAP says that stability implies abstraction. Thus 
dependencies run in the direction of abstraction.
The DIP, however, is a principle that deals with classes—and with classes 
there are no shades of gray. Either a class is abstract or it is not. The 
combination of the SDP and the SAP deals with components, and allows that 
a component can be partially abstract and partially stable.
M e a s u r i n g A b s t r ac ti o n
The 
A
metric is a measure of the abstractness of a component. Its value is 
simply the ratio of interfaces and abstract classes in a component to the total 
number of classes in the component.

Nc: 
The number of classes in the component.

Na: 
The number of abstract classes and interfaces in the component.

A: 
Abstractness. 

=
Na 
,
 Nc.
The 

metric ranges from 0 to 1. A value of 0 implies that the component has 
no abstract classes at all. A value of 1 implies that the component contains 
nothing but abstract classes.

Download 6,37 Mb.

Do'stlaringiz bilan baham:
1   ...   78   79   80   81   82   83   84   85   ...   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