Book Image

Service Oriented Java Business Integration

Book Image

Service Oriented Java Business Integration

Overview of this book

Table of Contents (23 chapters)
Service Oriented Java Business Integration
Credits
About the Author
Acknowledgement
About the Reviewers
Preface

Proxy—A Primer


Wikipedia defines Proxy as:

Proxy may refer to something which acts on behalf of something else.

In the software a proxy is a substitute for a target instance and is a general pattern which appears in many other patterns in different variants.

Proxy Design Pattern

A proxy is a surrogate class for the target object. If a method call has to be invoked in the target object, it happens indirectly through the proxy object. The feature which makes proxy ideal for many situations is that the client or the caller is not aware that it is dealing with the proxy object. The proxy class is shown in the following figure:

In the above figure, when a client invokes a method target towards the Target service, the proxy intercepts the call in between. The proxy also expose a similar interface to the target, hence the client is unaware of the dealing with the proxy. Thus the proxy method is invoked. The proxy then delegates the call to the actual target since it cannot provide the actual functionality...