Design Patterns : Elements of Reusable Object-Oriented Software


Design Patterns: Elements of Reusable Object-Oriented Software



Download 4,06 Mb.
Pdf ko'rish
bet177/288
Sana07.04.2022
Hajmi4,06 Mb.
#535140
1   ...   173   174   175   176   177   178   179   180   ...   288
Bog'liq
GOF Design Patterns

Design Patterns: Elements of Reusable Object-Oriented Software 
262 
Related Patterns 
Chain of Responsibility is often applied in conjunction with Composite (183). 
There, a component's parent can act as its successor. 


Design Patterns: Elements of Reusable Object-Oriented Software 
263 
Command 
Intent 
Encapsulate a request as an object, thereby letting you parameterizeclients with 
different requests, queue or log requests, and supportundoable operations. 
Also Known As 
Action, Transaction 
Motivation 
Sometimes it's necessary to issue requests to objects without knowinganything 
about the operation being requested or the receiver of therequest. For example, 
user interface toolkits include objects likebuttons and menus that carry out a 
request in response to user input.But the toolkit can't implement the request 
explicitly in the buttonor menu, because only applications that use the toolkit 
know whatshould be done on which object. As toolkit designers we have no wayof 
knowing the receiver of the request or the operations that willcarry it out. 
The Command pattern lets toolkit objects make requests of unspecifiedapplication 
objects by turning the request itself into an object. Thisobject can be stored 
and passed around like other objects. The key tothis pattern is an abstract Command 
class, which declares an interfacefor executing operations. In the simplest form 
this interfaceincludes an abstract Execute operation. Concrete Command 
subclassesspecify a receiver-action pair by storing the receiver as an 
instancevariable and by implementing Execute to invoke the request. Thereceiver 
has the knowledge required to carry out the request. 



Download 4,06 Mb.

Do'stlaringiz bilan baham:
1   ...   173   174   175   176   177   178   179   180   ...   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