Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Examples

examp12.cpp

This example is to show use of the Proxy pattern.

Our focus is on the use of restrictive access to accessors and mutators.

Contributors

AbstractBankAccount - which has the usual interface for fund management.

BankAccount - Concrete implementation of above

AccountProxy - Non-restrictive proxy which derives from subject

RestrictedAccountProxy - subclass of AccountProxy which restricts access to deposits and displays only.

Notes:

By deriving the base AccountProxy from AbstractBankAccount, the proxy can be used as the latter (as in our example). But this is not required, if you want your application to expose the proxy types then you wouldn't need to derive from the domain types. This may prove more flexible in a complex class model.


This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium