Clean Architecture


Chapter 20 Business Rules



Download 6,37 Mb.
Pdf ko'rish
bet124/259
Sana26.02.2022
Hajmi6,37 Mb.
#465587
1   ...   120   121   122   123   124   125   126   127   ...   259
Bog'liq
Clean Architecture A Craftsman’s Guide to Software Structure and Design by Robert C. Martin (z-lib.org)

Chapter 20 Business Rules
194
communicated to the user, or to any other component. We certainly don’t 
want the code within the use case class to know about HTML or SQL!
The use case class accepts simple request data structures for its input, and 
returns simple response data structures as its output. These data structures 
are not dependent on anything. They do not derive from standard framework 
interfaces such as 
HttpRequest
and 
HttpResponse
. They know nothing of 
the web, nor do they share any of the trappings of whatever user interface 
might be in place. 
This lack of dependencies is critical. If the request and response models are 
not independent, then the use cases that depend on them will be indirectly 
bound to whatever dependencies the models carry with them. 
You might be tempted to have these data structures contain references to 
Entity objects. You might think this makes sense because the Entities and the 
request/response models share so much data. Avoid this temptation! The 
purpose of these two objects is very different. Over time they will change for 
very different reasons, so tying them together in any way violates the 
Common Closure and Single Responsibility Principles. The result would be 
lots of tramp data, and lots of conditionals in your code.
C o n c lu s i o n
Business rules are the reason a software system exists. They are the core 
functionality. They carry the code that makes, or saves, money. They are the 
family jewels. 
The business rules should remain pristine, unsullied by baser concerns such as 
the user interface or database used. Ideally, the code that represents the 
business rules should be the heart of the system, with lesser concerns being 
plugged in to them. The business rules should be the most independent and 
reusable code in the system.
www.EBooksWorld.ir



Download 6,37 Mb.

Do'stlaringiz bilan baham:
1   ...   120   121   122   123   124   125   126   127   ...   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