Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just started reading about spring , and a book mentioned "Spring AOP is a Proxy based framework" . What is meant by "Proxy based" framework.

share|improve this question
It's a reference to a proxy design pattern. – Yuriy Zubarev Mar 19 '11 at 7:15
up vote 5 down vote accepted

The framework is using the java.lang.reflect.Proxy to do the work

In general Aspect Oriented Programming (AOP) in Java is implemented by means of instrumenting the target objects in some manner. There are many ways to do this but a common approach is to use the Proxy class.

This provides a facility to create a new object at runtime based on a given interface. You can then adjust the behaviour of the proxy to include extra features, such as logging or security boilerplate code, before handing control over to the original object.

An alternative approach, is to use subclassing. The proxy extends the original class and weaves the aspect before handing back to the super class. This fails if your class has final methods that need proxying.

You can read more about it in the Java reference here:

Alternatively, take a look at Spring in Action (pp 124).

share|improve this answer

As Gary Rowe says: some implementations of Aspect Oriented Programming generally rely on the imposition of a layer between the object and the rest of the system. This layer is usually called a proxy or a dynamic proxy.

From the Castle Project site:

Proxy objects can assist in building a flexible application architecture because it allows functionality to be transparently added to code without modifying it. For example, a class could be proxied to add logging or security checking without making the code aware this functionality has been added.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.