Saturday, May 17, 2014

Virtual Proxy Pattern in Java

Simple Note

(From SO)
A Virtual Proxy creates expensive objects on demand

(From Wiki)
Lazy initialization is the tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed.


Run to test.

ProxyFactorial will create and cache the Factorial object on demand.


Proxy pattern

Lazy initialization

Great answer at SO


No comments:

Post a Comment