Design Patterns : Elements of Reusable Object-Oriented Software



Download 4,06 Mb.
Pdf ko'rish
bet62/288
Sana07.04.2022
Hajmi4,06 Mb.
#535140
1   ...   58   59   60   61   62   63   64   65   ...   288
Bog'liq
GOF Design Patterns

Command Pattern 
Lexi's commands are an application of the Command (263) pattern, which describes 
how toencapsulate a request. The Command pattern prescribes a uniforminterface 
for issuing requests that lets you configure clients tohandle different requests. 
The interface shields clients from therequest's implementation. A command may 
delegate all, part, or noneof the request's implementation to other objects. This 
is perfect forapplications like Lexi that must provide centralized access 
tofunctionality scattered throughout the application. The pattern alsodiscusses 
undo and redo mechanisms built on the basic Commandinterface. 
Spelling Checking and Hyphenation 
The last design problem involves textual analysis, specifically checkingfor 
misspellings and introducing hyphenation points where needed forgood formatting. 
The constraints here are similar to those we had for the formattingdesign problem 
in Section 2.3.As was the case for linebreaking strategies, there's more than 
oneway to check spelling and compute hyphenation points. So here toowe want to 
support multiple algorithms. A diverse set of algorithmscan provide a choice of 
space/time/quality trade-offs. We shouldmake it easy to add new algorithms as 
well. 


Design Patterns: Elements of Reusable Object-Oriented Software 
78 
We also want to avoid wiring this functionality into the documentstructure. This 
goal is even more important here than it was in theformatting case, because spelling 
checking and hyphenation are justtwo of potentially many kinds of analyses we 
may want Lexi tosupport. Inevitably we'll want to expand Lexi's 
analyticalabilities over time. We might add searching, word counting, acalculation 
facility for adding up tabular values, grammar checking,and so forth. But we don't 
want to change the Glyph class and all itssubclasses every time we introduce new 
functionality of this sort. 
There are actually two pieces to this puzzle: (1) accessing theinformation to 
be analyzed, which we have scattered over the glyphsin the document structure, 
and (2) doing the analysis. We'll look atthese two pieces separately. 

Download 4,06 Mb.

Do'stlaringiz bilan baham:
1   ...   58   59   60   61   62   63   64   65   ...   288




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