This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have been reading threads in the forum about the session state storage mechanisms. A common approach is to store state in SFSB's -in ejb tier- (flights reserved, user Id, etc..) and store that beans's handle in web tier.(httpSession). I would like to bring an other approach and I would like to know your opionions on this..
Instead of storing session in EJB tier I would like to store it web tier. I think state replication (scability) is better and faster for web containers than ejb containers and storing state in EJB tier results as less scability than storing state in web tier. (Web containers geared better for session replication than EJB container.) I got this notion after reading some books on the issue (J2EE design and programming by Rod Johnson). And It makes sense. EJB is a beast and you do not need it at all for little tasks (fecthing date from db.) If you are using EJB one should have a need for distributed application and some proof of his/her need.
The swing client (whether applet or java application) can store the state on its own memory (on the client machine). I think there is no need to store state on the server for this types of clients. And the swing client can access EJB tier thru a servlet. Messages can be passed as XML documents between the swing client and the servlet.(the only overhead will be XML parsing, etc). Because directly accesing EJB tier will expose our business logic to everbody.And It will introduce firewall issues.
Instead, I would assume using web tier for all types of clients (using servlet) and storing session state on the web tier for web clients. (userId, flight information.) and I would assume to keep session state on the cliet itself for swing clients.
Has anybody any opionions on this.? I want to get to the facts instead of Sun's promotions and marketings.