Refer to Kyle Brown's article on
Session Facade.
My 2 cents (take this with a grain of salt because I'm no expert
):
1. Using a Session facade in your
Servlet ties it directly to the J2EE layer. I would put another layer such as a BrokerInterface layer between my servlet and the actual persistence mechanism. This will make it easier to switch between persistence mechanisms, e.g. if you want to use XML to
test, MS-SQL Server to integrate, Oracle or DB2 for production. You won't have to have different versions/methods of the Servlet to handle different persistence layers, you'll just program to an interface in the Servlet and switch persistence layers.
2. Using the Session facade the way you propose (delegate gets) gains you nothing. The session facade should simplify the interface to the entity, not just serve as a pass-through. Use a Value Object (aka Data Transfer Object) as a parameter to the Session Facade. I.e.:
ActionForm <--> Data Transfer Object <--> BrokerInterface <--> Session Facade <--> Entity Bean
It may seem like a roundabout way but it is a more flexible design, IMHO.
Junilu