7 responses

  1. Andrei Olaru
    November 15, 2012

    Good article to describe the pattern! Well done!

    I have some questions: how would you implement a lazy-loading architecture through this pattern? Or would you not use it?

    • IdioTechie
      November 18, 2012

      Hi Andrei,
      Thanks for visiting this article. Going by the definition of Lazy loading it is a design pattern to defer the initialization of an object until the point at which it is needed. If you refer to the Virtual Proxy example (ProxyImage.java : Line 14) we are trying to implement the Lazy loading already. The RealImage is not instantiated until it is first called. Hope this makes sense. Please let me know your thoughts.

      • Khajan
        July 31, 2014

        Nice article ! Short and simple.

  2. manoj
    September 26, 2013

    Proxy Design Pattern in Java, lazy loading using Proxy Design Pattern

    What is Proxy Design Pattern

    1. Proxy design patten works on the principal of exposing an Java Instance through a proxy instead of actual object.

    2. Client would never know anything about actual object and through Proxy only relevant behavior of actual object will be exposed to client.

    3. Proxy Pattern can be used for applying security on actual Object. Service provider does not want actual class to be visible to any client Instead It would be shared as per Client contract agreement . Service provider may agree to share only a part of Service with it’s client and for that It may expose a different contract in the form of interface in java .

    4. This concept is very useful for lazily loading an instance . Data will be loaded only when it is actually required in an operation .

    Learn more about proxy design pattern here — Proxy Design Pattern


  3. Ramasubramani N
    April 13, 2014

    Nice Article !!!

  4. Khajan
    July 31, 2014

    Nice article ! Short and simple.

Leave a Reply




Back to top
mobile desktop