Class Client Responsibilities
Collaborators |
Class Proxy Responsibilities
Collaborator |
Class AbstractOriginal Responsibilities
Collaborators - |
Class Original Responsibilities
Collaborators - |
Client need to do a task
Client calls the method of Proxy (send a service message)
Proxy internally do pre-processing such as mapping to Original
Proxy sends the real service message to Original
Result returned and Proxy do post-processing and return results back to Client
Remote Proxy: clients or remote components should be shielded from network addresses and inter-process communication protocols
Protection Proxy: Components under access control
Cache Proxy: Multiple clients share read-only results from remote components
Synchronization Proxy: Multiple simultaneous accesses to a component must be synchronized
Counting Proxy: Audit trail for component counts
Virtual Proxy: Shield the whole component but only provide the information as needed
Firewall Proxy: Protect local client from outside world
Advantages
Disadvantages