December 2017
Intermediate to advanced
468 pages
13h 12m
English
The proxy pattern suggests providing a placeholder (surrogate) for another object to control and get access to it. It is the best fit for lazy loading of objects (defer the creation and initialization until we need to use it).

The preceding diagram shows a sample implementation of a proxy pattern for a payment class, and the payment can be either by check or by pay order. However, the actual access would be to DebitAccount object, so PayOrderProxy and CheckProxy are both surrogates for Debit Account.
The following are the benefits:
Read now
Unlock full access