GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-design-patterns/proxy/README.md at master · wangwch/java-design-patterns

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
46 lines (35 loc) · 1.33 KB
/

README.md

Copy path

File metadata and controls

46 lines (35 loc) · 1.33 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions
layout pattern
title Proxy
folder proxy
permalink /patterns/proxy/
categories Structural
tags
Java
Gang Of Four
Difficulty-Beginner

Also known as

Surrogate

Intent

Provide a surrogate or placeholder for another object to control access to it.

alt text

Applicability

Proxy is applicable whenever there is a need for a more versatile or sophisticated reference to an object than a simple pointer. Here are several common situations in which the Proxy pattern is applicable

  • a remote proxy provides a local representative for an object in a different address space.
  • a virtual proxy creates expensive objects on demand.
  • a protection proxy controls access to the original object. Protection proxies are useful when objects should have different access rights.

Typical Use Case

  • control access to another object
  • lazy initialization
  • implement logging
  • facilitate network connection
  • to count references to an object

Real world examples

  • java.lang.reflect.Proxy
  • Apache Commons Proxy

Credits

  • Design Patterns: Elements of Reusable Object-Oriented Software
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.