UI architecture

De Assothink Wiki
Aller à la navigation Aller à la recherche

Intro

The Assothink / EPM project involves

computing daemon (EPM engine) running in C or in Java

data servers and data controllers abel to server UI applications and to launch daemons (running in Java)

UI (front-end) running as applic or within browsers

The point here is the suitable architecture and tools for the 3rd family : the UI (user interface) 

3 solutions compared

Needs GWT JavaFX Applicet
Runs as applic no yes !? yes
Runs in browsers yes yes yes
Requires tomcat server yes no no
Requires JVM clientside no yes yes
Full Java written yes yes yes
Swing ? GWT! Prism Swing
Anim library gwtAnim  ?? anim
Other mscp libs most yes yes
Access to server files request/answer  ?? sockets?
Local storage (20Mb) 5Mb  ??  ??


JavaFX vs Swing

It is sais that (1) JavaFX will 'replace' Swing, and (2) JavaFX can coexist with Swing.

Notes on javaFX : local and remote storage

There is no equivalent of javafx.io.Storage and javafx.io.Resource in JavaFX 2.x itself. Because JavaFX 2.x is based on Java, you can use Java services.

The JNLP FileSaveService and FileOpenService may be used. These services should work across JNLP based deployments (browser embedded and webstart apps) - not sure if they work for standalone apps.

If you know that your application will be run as a standalone app or a signed browser embedded or webstart app with higher privileges, then you can get the user directory via the user.home system property and write your app data to an an appropriate file location under that, probably using the Files api as in this Files tutorial. For example, use the Files api to create a {$user.dir}/.myapp/appdata.dat file to read and write.

JavaFX does embed an html5 webengine, but unfortunately (as of JavaFX 2.2), I don't think it implements the offline storage portion of the html5 specification (otherwise, you could probably have used that as an alternative).

JavaFX proof of concept (dec 2012)

Write a simple javaFX codes (extended "Hello, world") that

  • works as applic
  • works in browsers
  • access user (local) storage
  • reads server storage
  • interacts with server through simple messages