Roles

[Previous] [Next]

The roles and functions of the Smart Proxy design pattern are as follows:

  • Abstraction (Person) The interface that is implemented by both the SmartProxy class and the RealClass class. Abstraction allows SmartProxy to represent the real object in any context where the real object might be required.
  • RealClass (RealPerson) Defines the implementation for the real object.
  • SmartProxy (SmartProxyPerson) Represents the real object in a given context. When the real object is remote to the client process's address space, the SmartProxy object can cache the state of the real object to provide optimal performance. It can also accumulate updates to the state and submit the updates as a single request to the real object.
    • To manage the costly creation process and memory allocation of the real object, the SmartProxy object can delay instantiating the real object until specific functionality is requested by the client.
    • The SmartProxy object can provide secure access to the real object. For example, one user might have rights to change the state of the real object, while another might have rights only to look at the state.


Microsoft Visual Basic Design Patterns
Microsoft Visual Basic Design Patterns (Microsoft Professional Series)
ISBN: B00006L567
EAN: N/A
Year: 2000
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net