Some architecture thoughts and questions (somewhat long...)

From: Alexander Lamb (Alexander.J.Lam..im.hcuge.ch)
Date: Fri Jan 14 2005 - 10:43:56 EST

  • Next message: Pirola Davide: "ResultSet with ORACLE Stored Procedure OUT Parameter"

    Hello list!

    This post is more architecture oriented but I felt that since there is
    a Cayenne component, I might try here. Moreover, I have the feeling it
    is on this list I will find the people who "think the right way", more
    than on Java or Flash lists.

    The problem: developing a kiosk like application to handle the patients
    flow in various sectors of a hospital (initially, emergency room). Has
    to be very graphic (HTML eliminated) and is distributed. Users are
    mostly nurses but also physicians.

    The application is multi-teared. We already have several systems with
    Web-Services interfaces to read patients info, admissions, movements,
    notifications, lab results, etc... Those apps are mostly Java Based.

    In addition to the connexion to the hospital data using Web-Services,
    we shall have an Oracle database to handle data specific to the
    application.

    A rule system (probably Jess) will certainly handle issues like alerts
    (patient with severity 2 is waiting for more than 20 minutes, abnormal
    lab result for patient,...).

    The client will be "thick". It has to be very graphical. I made a
    prototype in Swing a few months ago. Actually, you can't see it is
    Swing because I handle most of the drawing "in the old fashion way...
    move to, line to...". The client being heavy, it will not only rely on
    pulling data from the server(s) but also getting notified by the
    server. The servers have to keep a list of clients and push data
    (notifications, movements, etc...).

    Now where is Cayenne involved? Well, here are the points that I am
    having a hard time answering. Some cover Cayenne, some are at the
    border of Cayenne, but I have to consider the solution as a whole.

    1. Cayenne and non SQL data-sources

    Having worked at NeXT and growing up with EOF, I know the advantages of
    ER mapping. However, since we have many data-sources, some of which are
    not SQL, I would like to know it it is possible to insert existing
    objects into a data context even if they are not coming from a
    relational database. The idea is to have a coherent view on my object
    graph. Would you create a custom data source (could be read only but
    also read write) for Web-Services? Or would you simply read the data
    the traditional way and then insert the objects in the data context.
    I need the data in the data context (and not only linked to other
    objects in the data context) because I will want to mirror content of
    the data contexts.

    2. Cayenne and mirroring

    I understand (I think) that in version 1.2, Cayenne will be able to
    keep in sync the data contexts in several apps and several machines. So
    imagine I have a client which has a session with a data context on
    server A. The client shows a given type of data (all the patients in
    the waiting room for example). Then if I start another client on
    another machine in the hospital which will also have a session and a
    data context and I want to see the patients in the waiting room, I
    would like to have the data contexts keep in sync. When one is modified
    (the user changes the priority of one patient, or a new patient is
    admitted for example) the second data context is kept in sync and a
    notification is sent to update whatever gui might be running.

    Now, imagine the client is a thick client and has its own data context.
    When connecting to the server, a session is created a data context is
    created. I suppose I can "link" the data context of the client and the
    one of the server (a bit like what JavaClient is doing in WO) and
    whenever the data context of the server is modifier (object changes,
    new object, etc...) the data is pushed on the client which will then
    update the gui. The other way round, when the client pushes data back
    on the server, the server might replicate that change to a data context
    in the session of another thick client which in turn will notify the
    client. Doing so (with some additional issues of course) would mean
    that any change on one client would be automatically seen on the other
    clients which are looking at the same views.
    Is that possible?

    3. GUI handling

    Having "fought" with Swing for a few weeks, I learned at least one
    thing: I am NOT going to write any other Swing app unless I find a real
    controller layer.
    I had some exchanges with Andrus some time back about the lack of
    controller layer in Swing. He wrote a nice article in The Server Side
    about the problem and suggested JStaple.
    It has a relation with Cayenne because obviously for things to work
    well with the controller or "bindings" (as in Cocoa) principles, you
    need the objects to notify any change in order for the gui to be
    updated accordingly.
    Now, if I wanted to start thinking out of the box, there would be
    another possibility for the gui: Flash. Using Flash MX Professional,
    there is a "real language" a framework to handle bindings with the data
    a little bit like in Cocoa, the results are usually graphically rather
    convincing (better than Swing anyhow). You can run a Flash app in a
    Flash player without a browser. Flash can communicate with a server
    through HTTP, etc... decode XML, etc...
    Would it be "reasonable" to use Flash (and a product called Flash
    Remoting maybe) to handle the gui part?

    Lets see.

    Advantages of Java on the client:

    - Same language on client and server. Can leverage classes use, etc...
    - Cayenne 1.2 should enable synchronization of client and server: both
    ways
    - We (me, the other developers, know Java)

    Disadvantages of Java on the client:

    - Usually slow, heavy and difficult to make nice looking graphics,
    widgets, etc...
    - Swing
    - Need to find / develop / participate in development of a controller
    layer

    Advantages of Flash on the client:

    - Easy to make stunning and fast graphics with good user interaction
    (did I forget to say we shall have touch screens to accelerate choices:
    you point to a patient and point to a room: the patient moves)
    - Builder (Flash IDE)
    - Real controller layer (bindings)
    - Lightweight, cross platform, easy to deploy
    - Good language (Action Script 2)

    Disadvantages of Flash on the client:

    - New language and environment to learn and maintain
    - Difficult to keep in sync (how) client data context (or equivalent in
    Flash) and server data context

    In summary:

    - Java on the client requires:

            - JStaple or pendulum or other equivalents
            - Lots of low level graphics programing

    - Flash on the client requires:

            - Learning a new environment
            - writing a data layer synchroniser between Flash Objects and a
    Cayenne data context

    What do you think?
    Idea? Experiences?

    Thanks a lot,

    --
    Alexander Lamb
    Geneva University Hospital
    http://www.sim.hcuge.ch/
    Prof. +41 22 372 88 62
    Portable +41 79 420 79 73
    

    -- Alexander Lamb Service d'Informatique Médicale Hôpitaux Universitaires de Genève Prof. 022 372 88 62 Portable 079 420 79 73



    This archive was generated by hypermail 2.0.0 : Fri Jan 14 2005 - 10:44:03 EST