Clean Architecture


Chapter 22 The Clean Architecture



Download 6,37 Mb.
Pdf ko'rish
bet133/259
Sana26.02.2022
Hajmi6,37 Mb.
#465587
1   ...   129   130   131   132   133   134   135   136   ...   259
Bog'liq
Clean Architecture A Craftsman’s Guide to Software Structure and Design by Robert C. Martin (z-lib.org)

Chapter 22 The Clean Architecture
208
Figure 22.2 
A typical scenario for a web-based Java system utilizing a database
The job of the 
Presenter
is to repackage the 
OutputData
into viewable 
form as the 
ViewModel
, which is yet another plain old Java object. The 
ViewModel
contains mostly 
Strings
and flags that the 
View
uses to display 
the data. Whereas the 
OutputData
may contain 
Date
objects, the 
Presenter
will load the 
ViewModel
with corresponding 
Strings
already 
formatted properly for the user. The same is true of 
Currency
objects or any 
other business-related data. 
Button
and 
MenuItem
names are placed in the 
ViewModel
, as are flags that tell the 
View
whether those 
Buttons
and 
MenuItems
should be gray. 
This leaves the 
View
with almost nothing to do other than to move the data 
from the 
ViewModel
into the 
HTML
page.
Note the directions of the dependencies. All dependencies cross the boundary 
lines pointing inward, following the Dependency Rule.
www.EBooksWorld.ir


Conclusion
209
C o n c lu s i o n
Conforming to these simple rules is not difficult, and it will save you a 
lot of headaches going forward. By separating the software into layers 
and conforming to the Dependency Rule, you will create a system that is 
intrinsically testable, with all the benefits that implies. When any of the 
external parts of the system become obsolete, such as the database, or the 
web framework, you can replace those obsolete elements with a minimum 
of fuss.
www.EBooksWorld.ir


This page intentionally left blank 
www.EBooksWorld.ir



Download 6,37 Mb.

Do'stlaringiz bilan baham:
1   ...   129   130   131   132   133   134   135   136   ...   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