This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaFX and application structure

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jim, given what little I've read of JavaFX (mostly here this week), I'm wondering how you see JavaFX affecting RIA structure. I can envision two types of app structure: (of course, everything in between is possible as well -- or even something completely different)

1) Apps similar to today's RIA's. Model, business logic, and control on server. View generation on server (JSP et al) goes away in favor of display-only JavaFX code on client. Lots of communication with the server delivering small requests. JavaFX, in effect, takes place of HTML/JavaScript Ajax front-end.

In this scenario, the server code is pretty much unchanged from today's RIA's with the exception of removing page-generation.

2) Full MVC moves to the client with the Model replicated via HTTP from the server.

In this scenario, the server code is drastically changed to merely keep track of the persisted Model and feed it to the fat client. At what point does it stop being a RIA and just become a RA (aka desktop client/server app)?

Which do you see happening? Why?
[ April 02, 2008: Message edited by: Bear Bibeault ]
 
James Weaver
author
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My preference is a blend of the two approaches that you mentioned. JavaFX Script is meant to be used in such a way that the UI is declaratively expressed, and bound to a model that is articulated in JavaFX classes. I like to use a lightweight model that has the responsibility of interacting with the server as necessary. So the model holds data necessary for the UI in an MVC fashion. That data is often state (such as currently selected element in a ListBox), as well as data from the server (cached in some cases for optimization). Because JavaFX can access Java classes directly, the functions in the model classes have many choices in how they communicate with the server (wrapping Java classes, or using JavaFX JSON/XML libraries, etc.)

The Freebase Browser post has a diagram that represents the architectural pattern that I've been using.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see. Interesting hybrid. I assume that the MVC architecture on the client is still display-focused and that business logic remains on the server in that scenario?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've seen/heard-of some RIAs where this sort of thing -- implementing a full MVC app -- on the client, in JavaScript no less -- is done. The business logic remains on the server and the client-side Model only contains what data is necessary to keep the UI "fed".

It's not an app structure I've investigated deeply, but just pointing out that there's precedent for the type of app construct James is talking about, if I am understanding him correctly.
[ April 03, 2008: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic