In order to get the complete control of undergoing process in any software application, wrappers plays a vital role.Most of the big framework like Spring, Hibernate and Jdbc have this kind of wrappers.In general you can say wrappers are the outer layer of the main object.In Spring security(Formly known as acegi security) we have request wrappers through this request wrapper acegi security decides that each incomming request has authenticate header or not?
How Spring security framework does this ? this is a very simple process. Each and every HttpRequest has to pass some filters configured on some external xml files. These filters inject some information in Httprequest headers, and instead of using the main Request facade spring security uses the wrappers of the request and application will not operate untill and unless request contains the authentication tokens, In this way wrappers are providing security through out the Lifecycle of Request.
A part of the web application there are some wrappers are also available for Jdbc, Log4Jdbc is a project which is hosted in google,which provides the complete log of queries executed by the native Jdbc driver. The idea behind this is also same, Yes you guessed right it is Wrapers .
The main funda is instead of modifing the functionality of main component make wrapper of the it, leave the extension points for plugging the wrappers object. Let it be seprate and independent.
How Spring security framework does this ? this is a very simple process. Each and every HttpRequest has to pass some filters configured on some external xml files. These filters inject some information in Httprequest headers, and instead of using the main Request facade spring security uses the wrappers of the request and application will not operate untill and unless request contains the authentication tokens, In this way wrappers are providing security through out the Lifecycle of Request.
A part of the web application there are some wrappers are also available for Jdbc, Log4Jdbc is a project which is hosted in google,which provides the complete log of queries executed by the native Jdbc driver. The idea behind this is also same, Yes you guessed right it is Wrapers .
The main funda is instead of modifing the functionality of main component make wrapper of the it, leave the extension points for plugging the wrappers object. Let it be seprate and independent.
Comments
Post a Comment