---What is Session Facade?
A Session Facade is implemented as a session enterprise bean. It provides clients with a single interface for the functionality of an application or application subset. The EJB Session Facade pattern wraps entity beans with session beans so that the entity beans aren't directly accessed by clients. The pattern goes beyond simple wrapping to help you structure the objects called by the session beans.
Use the Facade pattern when:
1) you want to provide a simple interface to a complex subsystem
2) you want to layer your subsystems
3) to define an entry point to each subsystem level
There are a couple of ideas we can extract out of that discussion of the Facade pattern. The first is that a Facade should provide an abstract view of the subsystem, rather than simply directly wrapping the API of the whole subsystem itself.
The second, subtler point involves layering. The idea here is that you may employ multiple Facades to hide the details of successive subsystems. So here you can imagine that a Session Facade might be layered on top of other Facades that further abstract away the details of the underlying business logic. This is a crucial point.
Facades don't do the real work of a system; they instead delegate to other objects that in turn do the work
posted on 2006-10-28 15:15
Sun River 阅读(236)
评论(0) 编辑 收藏 所属分类:
Design Pattern