Take the 2-minute tour ×

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

2 Answers 2

up vote 4 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: http://download.oracle.com/javase/6/docs/api/java/lang/reflect/Proxy.html

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:


share|improve this answer

Your Answer


