Monday, May 17, 2010

Popular Design Patterns

When you do repeated code for authentication, authorization etc in each and every servlet, then you need to implement Front Controller to get rid of all those repeated code. Your front controller is also responsible for invoking the right component to perform your business need.

When your client needs complex business logic like getting data from multiple entities then you need to implement Session Facade where your session takes care of identifying unique requests and correlating multiple requests into one where by reducing the network overhead between client and presentation tire.

In most of the cases JNDI has either network overhead or io overhead. Its always beneficial to reduce number of JNDI lookups. ServiceLocater can be used to do that as it caches the resources obtained through JNDI lookups.


Business Delegate
is the right choice when you have your business components that are directly getting invoked from the presentation layer component. You can call this as a high level bridge pattern.