File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Session handling, web vs swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Session handling, web vs swing" Watch "Session handling, web vs swing" New topic
Author

Session handling, web vs swing

Trond Hjelmaas
Greenhorn

Joined: Oct 10, 2005
Posts: 5
Hi,

I was wondering if anyone could share their thoughts how to handle sessions (login etc) from mainly the Travel Agent (swing)?

My thoughts:
I have been trying to restrict usage of sessionbeans for performance reasons. I currently only one sessionbean which is the shoppingcart (to store the segments).
I also had an idea: When searching for flight, I wanted to store the result(s) in the HTTPSession (thus pushing flight data out to the webservers).

My problem:
How do I handle login from the swing client?
  • Let the swing app. handle security with login (easy to bypass)
  • While logging in to swing app. the app. server can verify the login details and give the swing client a uniq id. Everytime the swing app calls a method, this ID is sent as part of the paramters. This ID will have a timeout.
  • Use a sessionfacade for all clients (web and swing) and thereby use more resources
  • Any other suggestions?


  • Any suggestions are very welcome!
    Thanks in advance for replying

    :roll: Trond
    [ October 10, 2005: Message edited by: Trond Hjelmaas ]
    Sarbur sar
    Greenhorn

    Joined: Oct 10, 2005
    Posts: 13
    Hi,

    I would suggest keep all the seesion informations in business layer (Statefule Bean) itself, so that it will support both the client(web&swing). Moreover, SSB life cycle is controlled by the Container, container manages the resources.

    This is the way, I plan to design for both the clients.

    Planned to have 2 front controllers for web and swing clients respectively. This front controllers will talk to the business delegate class, which in turn calls the business layer.

    web client --> webFrontController--> BusinessDelegate-->session bean--> DAO
    Swing clien --> SwingFrontcontroller--> Rest are same as webclient.

    By this way, the same functionality can be supported by both the classes.

    Is my approach correct?

    Sarbur
    ravindra janapreddy
    Ranch Hand

    Joined: Jan 30, 2001
    Posts: 84
    Hi

    Why are we using two different clients? Web Client and Swing Client. Is the functionality of the Swing Client different from Web Client. My understanding is both the actors 'Travel Agent' and 'Customer' are accessing the same use cases functionality. I have designed only one client i.e 'Web Client'. Usually we create a Swing client whenever we have a functionality accessible only to internal users and normally not accessible to all the users on the web.

    Thanks

    -- Ravi


    SCEA, SCBCD, SCWCD, SCJD, SCJP
    rottscha rotti
    Greenhorn

    Joined: Jan 18, 2005
    Posts: 21
    Oh yes, the TravelAgent does something additional to the customer:

    He must be able to act in his role i.e. customer tells the travel agent his username and the agent needs not to login but to act in the role of this login and verify that the username exists and matches some personal data of that account.

    Another reason is that FBN recommended the best possible performance for travelagents and a swing client has a better performance than a WebGUI.

    Any thoughts about that

    rottscharabbit
    ravindra janapreddy
    Ranch Hand

    Joined: Jan 30, 2001
    Posts: 84
    Hi

    I looked at the requirement specification once again. This is what the specification has to say on this matter:

    In addition to FBN travel agents, they want to make it easier for consumers to book travel, so they would like a web site for booking airfare [Web Client]. FBN would like to make the user interface more appealing for their travel agents by replacing the 3270 terminal with one that can support a graphical user interface[Swing Client].

    So we need to design a Swing based front-end application(MVC) for the Travel Agent and any Web Application Framework (for e.g. Struts) based front-end application(MVC) for the Customer. The Travel Agent Swing Application will support the customer who call in the Travel Agent on the phone for the quotes.

    I am modifying my design with this latest design change.

    Thanks

    -- Ravi
    Giju George
    Ranch Hand

    Joined: Jun 08, 2004
    Posts: 333
    How do I handle login from the swing client?
  • Let the swing app. handle security with login (easy to bypass)
  • While logging in to swing app. the app. server can verify the login details and give the swing client a uniq id. Everytime the swing app calls a method, this ID is sent as part of the paramters. This ID will have a timeout.
  • Use a sessionfacade for all clients (web and swing) and thereby use more resources
  • Any other suggestions?



  • Why don't you consider using JAAS for login?


    SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCEA
    ravindra janapreddy
    Ranch Hand

    Joined: Jan 30, 2001
    Posts: 84
    Hi Rottscha

    Login issues: Responsibility of FBN DBA administrator and not Travel Agent who like the customer is an extenal user of the FBN system.

    Performance: Even if Swing based application is faster than a web based application (which I doubt), it alone can't be a reason to have two clients 1. Swing based 2. Web-based.

    I am still thinking on this issue why should we have two clients???

    Thanks

    -- Ravi
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Session handling, web vs swing
     
    Similar Threads
    QoS - Availability (part 2)?
    Questions related ro Security ??
    do we need to always access the business tier
    As i am drawing sequence diagram for prepare itinerary...
    partII: stateful session bean is necessary to serve as a booking cart?