Saturday, September 5, 2009

Strut Spring Hibernate and delegation pattern

I am reading about delegation pattern today...
Delegation pattern is used when a class A expresses some behavior or exposes some functionality using some API's but actual implementation is delegated to classes behind this class A. This enables putting one more layer between the classes.

Class A also provides API's so the client code which uses instantiate class A can also choose which supporting class functionality it should choose.

Wiki page has nice description on this with example:
http://en.wikipedia.org/wiki/Delegation_pattern



Second pattern that i was reading today was DAO pattern.
This pattern allows independence of data access resource mechanism and client side code. In raw terms, if back end resource changes then client side code should not be modified.

This page describes it best. http://java.sun.com/blueprints/patterns/DAO.html

Rest later

No comments:

Post a Comment