source: SAP community Dynamic Proxy mechanism is part of the standard Java SDK implementation under the java.lang.reflect package. This mechanism allows creating on the fly proxy implementation based on one or more interface types which can then be used interchangeably at runtime. This process allows leveraging many known patterns in code dynamically like interceptor, decorator, adapter, etc. In every case, the primary motive is to intercept the method calls and reroute or preprocess them to add or remove functional behaviors dynamically at runtime. Dynamic proxy classes are useful to an application or library that needs to provide type-safe reflective dispatch of invocations on objects that present public interfaces. To understand how proxying works it’s important to understand what the proxy pattern dictates. The Proxy pattern – A Brief Review The Proxy Pattern is an original Gang of Four (GOF) Structural pattern that was proposed wa...
An Architect's diary of fixes