Design Patterns : Elements of Reusable Object-Oriented Software



Download 4,06 Mb.
Pdf ko'rish
bet161/288
Sana07.04.2022
Hajmi4,06 Mb.
#535140
1   ...   157   158   159   160   161   162   163   164   ...   288
Bog'liq
GOF Design Patterns

protection proxy
controls access to the original object. Protection 
proxies are useful when objects should have different access rights. For 
example, KernelProxies in the Choices operating system [CIRM93] provide 
protected access to operating system objects. 
4.

smart reference
is a replacement for a bare pointer that performs 
additional actions when an object is accessed. Typical uses include 
o
counting the number of references to the real object so that it can 
be freed automatically when there are no more references (also called 
smart pointers
[Ede92]). 
o
loading a persistent object into memory when it's first referenced. 
o
checking that the real object is locked before it's accessed to ensure 
that no other object can change it. 
Structure 
Here's a possible object diagram of a proxy structure at run-time: 
Participants 

Proxy
(ImageProxy) 
o
maintains a reference that lets the proxy access the real subject. 
Proxy may refer to a Subject if the RealSubject and Subject interfaces 
are the same. 


Design Patterns: Elements of Reusable Object-Oriented Software 
236 
o
provides an interface identical to Subject's so that a proxy can 
by substituted for the real subject. 
o
controls access to the real subject and may be responsible for 
creating and deleting it. 
o
other responsibilities depend on the kind of proxy: 
§
remote proxies
are responsible for encoding a request and 
its arguments and for sending the encoded request to the real 
subject in a different address space. 
§
virtual proxies
may cache additional information about the 
real subject so that they can postpone accessing it. For 
example, the ImageProxy from the Motivation caches the real 
image's extent. 
Download 4,06 Mb.

Do'stlaringiz bilan baham:
1   ...   157   158   159   160   161   162   163   164   ...   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