supposed I design components to allow 2 types of clients (Web and Swing) accessing
EJB Tier.
The design as follow:
WebClient -> Controller ---\
---BD(business delegate) ->SF(SFSB) -> EntityBean(CMP)
SwingClient -> Controller --/
Each clienttype has its own controller to send the request to the BD.
assume this SCENEARIO WITH WEBCLIENT:
A client retrieve a list of flights via SF.
The flights are stored in the SF(for whatever purpose at later stage) while the BD stores the reference of SF.
This client can access to the 'retrieved flights' on subsequent requests on EJBTier (which is stored in SF) because the BD holds the reference of SF.
In this design, each client has an instance of BD and this BD instance is stored in httpsession.
But the problem arises whenever the same BD is used by Swing Client.(Agent).
The SWINGCLIENT SCENARIO:
An agent needs to serve multiple customers but the application only uses ONE instance of BD.
So whenever I use the same implementation of (BD - SF) I face with the problem of state management:
A data retrieved for a particular customer which is available(stored) in SF would not be useful for other clients.
So my questions will be:
1. Shall I use the same BD for Web and Swing client?
2. Where is the best to store the state? in EJBTier or Client Tier? The best for reducing network traffic would be EJBTier.
If I make the SF to be SLSB, I would solve this problem but the data would be manipulated in clienttier.
But whenever I insist to have SF as SFSB to reduce the traffic of transferring huge objects data, what would be the best solution?
Any suggestion on the component design?