1 Reply Latest reply on Jul 28, 2004 10:31 AM by Dave Smith

    JBossCache over HTTP for rich client communication

    Remy Gendron Newbie


      Anyone interesed in discussing some architectural patterns?

      I've read the forum, docs and tutorials but cannot determine if JBCache could be used in the following scenario. If this thread has already been covered, please forward me to it.

      Our current application architecture predates J2EE. It uses an in-house app server. The rich client (Delphi) accesses the server over HTTP using an XML (SOAP like) in-house protocol. The client has direct access to our bean/entity like domain objects and to remote (web like) services using typesafe meta-data. The problem related to a possible JBossCache usage is concurency. Our current architecture offers no isolation and the client often works on stale data. Relational integrity is enforced at the entity and db level, but we can easily have situations where editions are lost because another user worked on the same data at the same time.

      It's time we move to modern J2EE technologies. I've setup a tech showcase using MySQL (I've imported the IMDB movies database), JBoss 4.0, POJOs for the domain model (hand coded, no MiddleGen), Hibernate and ws4ee web services using stateless session beans. All good and well.

      Now the rich client? It will use web services for some requests, but getting access to the POJOs and caching them on the client side is mandatory to attain the kind of user experience we need to offer (PIM with lots of really complex edition). I don't want to go again with the DTO pattern we used in the preceding architecture. Even if the DTOs could be generated (they were hand coded until now), I'd like to reduce the complexity. Introduce JBossCache...

      So, can JBossCache be used on the client side and be part of the same cluster as the server? How would HTTP communication go? I'd like to use pessimistic locking/isolation. Would the performance be acceptable? Our domain model has users working mostly on their own data. There is a lot of quasi-read-only data shared between the clients, but editable data is rarely shared. But when it is, concurency/integrity should be ensured.

      Has anyone used JBossCache in a similar fashion?

      Thanx in advance for your inputs!


        • 1. Re: JBossCache over HTTP for rich client communication
          Dave Smith Newbie

          The conclusion I came to was that in writting Business Applications with a Rich Client interface we needed to tweak the MVC paradigm. I am working on javaclient.sourceforge.net (there is only stuff in CVS, basic example, putting together Web pages today as we speak.) My thought is to split the Controller into a Client Side and a Server Side, with the model getting replicated at client and server transparently using the JBoss invoker stack. The Server side being represented by a SSB. So the business logic updates the Server side model which then gets updated on the Client and propigates out to the view. That way the minimum amout of data is moving back and forth.

          I looked at using JBossCache to represent the model, but there are a couple of cases where you just want the data to flow through and not be saved. For example if you are browsing a customer list in a table you really only want to ship the data across the wire and view it. Then on each line store the primary key for the line and ship that back when the line is selected.

          I think the bigger issus is that the model only needs to be synchronized when a Server Controller method is called. Otherwise the data can just sit on the client and only be updated when it is needed on the server.