SlideShare a Scribd company logo
S.Ducasse 1
QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.
Stéphane Ducasse
Stephane.Ducasse@univ-savoie.fr
http://www.listic.univ-savoie.fr/~ducasse/
Proxy
S.Ducasse 2
License: CC-Attribution-ShareAlike 2.0
http://creativecommons.org/licenses/by-sa/2.0/
S.Ducasse 3
Proxy
• Category
• Structural
• Intent
• Provide a surrogate or placeholder for another object to
control access to it
• Also known as
• Surrogate
S.Ducasse 4
Proxy Pattern Motivation
S.Ducasse 5
Proxy Applicability
• A remote proxy provides a local representative for an
object in a different address space
• A virtual proxy creates expensive objects on demand
• A protection proxy controls access to the original
object, in order to enforce access rights
• A smart reference is a replacement for a bare pointer
that performs additional actions when an object is
accessed
S.Ducasse 6
Proxy Pattern Structure
S.Ducasse 7
Proxy Pattern Participants
• Proxy (ImageProxy)
• maintains a reference that lets the proxy access the real
subject
• provides an interface identical to Subject’s so that a
proxy can be substituted for the real subject
• controls access to the real subject and may be
responsible for creating and deleting it
S.Ducasse 8
Proxy Participants (continued)
• Subject (Graphic)
• defines the common interface for RealSubject and Proxy
so that a Proxy can be used anywhere a RealSubject is
expected
• RealSubject (Image)
• defines the real object that the proxy represents
S.Ducasse 9
Proxy Consequences
• Consequences
• A remote proxy can hide the fact that an object resides
in a different address space
• A virtual proxy can perform optimizations such as
creating an object on demand
• Both protection proxies and smart references allow
additional housekeeping tasks when an object is
accessed
S.Ducasse 9
Proxy Consequences
• Consequences
• A remote proxy can hide the fact that an object resides
in a different address space
• A virtual proxy can perform optimizations such as
creating an object on demand
• Both protection proxies and smart references allow
additional housekeeping tasks when an object is
accessed

More Related Content

PPTX
Open Access Repositories
PDF
DDS Interoperability Demo June 2013 (Berlin, Germany)
PPT
5 - OOP - Smalltalk in a Nutshell (c)
PPT
10 - OOP - Inheritance (a)
PPT
Stoop 431-visitor
PPT
Stoop 300-block optimizationinvw
PPT
Double Dispatch
Open Access Repositories
DDS Interoperability Demo June 2013 (Berlin, Germany)
5 - OOP - Smalltalk in a Nutshell (c)
10 - OOP - Inheritance (a)
Stoop 431-visitor
Stoop 300-block optimizationinvw
Double Dispatch

Viewers also liked (20)

PPT
Stoop ed-inheritance composition
PPT
Stoop 305-reflective programming5
PPT
Stoop 422-naming idioms
PPT
PPT
12 - Conditions and Loops
PPT
Stoop 423-some designpatterns
PPT
09 metaclasses
PPT
8 - OOP - Smalltalk Model
PPT
14 - Exceptions
PPT
Stoop 434-composite
PPT
Stoop ed-some principles
PPT
PPT
Debugging VisualWorks
PDF
Stoop 415-design points
PPT
Stoop sed-smells
PPT
10 - OOP - Inheritance (b)
PPT
PPT
Stoop ed-dual interface
PPT
03 standardclasses
PPT
07 bestpractice
Stoop ed-inheritance composition
Stoop 305-reflective programming5
Stoop 422-naming idioms
12 - Conditions and Loops
Stoop 423-some designpatterns
09 metaclasses
8 - OOP - Smalltalk Model
14 - Exceptions
Stoop 434-composite
Stoop ed-some principles
Debugging VisualWorks
Stoop 415-design points
Stoop sed-smells
10 - OOP - Inheritance (b)
Stoop ed-dual interface
03 standardclasses
07 bestpractice
Ad

Similar to Stoop 437-proxy (14)

PPT
Proxy pattern
PPTX
Proxy Design Pattern
PPSX
Proxy design pattern
PPTX
Proxy Design Patterns
PPTX
Proxy Pattern
PPTX
Introduction-to-Design-Patternsssss.pptx
PDF
Gang of four Proxy Design Pattern
PPT
Proxy pattern
PPTX
Proxy & adapter pattern
PDF
Proxy design pattern (Class Ambassador)
PPT
Stoop 421-design heuristics
PDF
Transparent Object Proxies for JavaScript
PDF
Александр Белецкий "Архитектура Javascript приложений"
PDF
Proxy OOP Pattern in PHP
Proxy pattern
Proxy Design Pattern
Proxy design pattern
Proxy Design Patterns
Proxy Pattern
Introduction-to-Design-Patternsssss.pptx
Gang of four Proxy Design Pattern
Proxy pattern
Proxy & adapter pattern
Proxy design pattern (Class Ambassador)
Stoop 421-design heuristics
Transparent Object Proxies for JavaScript
Александр Белецкий "Архитектура Javascript приложений"
Proxy OOP Pattern in PHP
Ad

More from The World of Smalltalk (19)

PDF
05 seaside canvas
PPT
PPT
12 virtualmachine
PPT
PPT
10 reflection
PPT
08 refactoring
PPT
Stoop sed-sharing ornot
PPT
Stoop sed-class initialization
PPT
Stoop sed-class initialization
PPT
Stoop metaclasses
PPT
Stoop ed-unit ofreuse
PPT
Stoop ed-subtyping subclassing
PPT
Stoop ed-frameworks
PPT
Stoop ed-class forreuse
PPT
Stoop 450-s unit
PPT
Stoop 440-adaptor
05 seaside canvas
12 virtualmachine
10 reflection
08 refactoring
Stoop sed-sharing ornot
Stoop sed-class initialization
Stoop sed-class initialization
Stoop metaclasses
Stoop ed-unit ofreuse
Stoop ed-subtyping subclassing
Stoop ed-frameworks
Stoop ed-class forreuse
Stoop 450-s unit
Stoop 440-adaptor

Stoop 437-proxy

  • 1. S.Ducasse 1 QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture. Stéphane Ducasse Stephane.Ducasse@univ-savoie.fr http://www.listic.univ-savoie.fr/~ducasse/ Proxy
  • 2. S.Ducasse 2 License: CC-Attribution-ShareAlike 2.0 http://creativecommons.org/licenses/by-sa/2.0/
  • 3. S.Ducasse 3 Proxy • Category • Structural • Intent • Provide a surrogate or placeholder for another object to control access to it • Also known as • Surrogate
  • 5. S.Ducasse 5 Proxy Applicability • A remote proxy provides a local representative for an object in a different address space • A virtual proxy creates expensive objects on demand • A protection proxy controls access to the original object, in order to enforce access rights • A smart reference is a replacement for a bare pointer that performs additional actions when an object is accessed
  • 7. S.Ducasse 7 Proxy Pattern Participants • Proxy (ImageProxy) • maintains a reference that lets the proxy access the real subject • provides an interface identical to Subject’s so that a proxy can be substituted for the real subject • controls access to the real subject and may be responsible for creating and deleting it
  • 8. S.Ducasse 8 Proxy Participants (continued) • Subject (Graphic) • defines the common interface for RealSubject and Proxy so that a Proxy can be used anywhere a RealSubject is expected • RealSubject (Image) • defines the real object that the proxy represents
  • 9. S.Ducasse 9 Proxy Consequences • Consequences • A remote proxy can hide the fact that an object resides in a different address space • A virtual proxy can perform optimizations such as creating an object on demand • Both protection proxies and smart references allow additional housekeeping tasks when an object is accessed
  • 10. S.Ducasse 9 Proxy Consequences • Consequences • A remote proxy can hide the fact that an object resides in a different address space • A virtual proxy can perform optimizations such as creating an object on demand • Both protection proxies and smart references allow additional housekeeping tasks when an object is accessed