Saturday, March 10, 2007

Unify the UI frameworks

On Java community there are a lot of options to be chosen when you want to start implementing an application that has a UI.
Depending on the type of the client you can choose frameworks like:
For web clients:
- struts 1.x, 2.0
- tapestry
- MyFaces
- Ajax based one: GWT, RAP
etc.

For desktop clients:
- Swing
- Eclipse RCP
etc.

There so many doing basically the same things but using different approaches.

When you want to implement an application having clients which use the application from:
- web
- mobile phones
- desktop
then you are in big trouble.

Which are your options:
- decide for each client the framework to be used
- do 3 times the same client UI using 3 frameworks ...
Pretty good right? And also "extremely efficient" ;(.


I have some questions:
- why should we have 3 different implementations?
- is the UI so different depending on the client type?

I think that answering to the second one, I have the answer for the first one :(.

From the development point of view, it should be only one implementation of the View which is used by the client, the differences are given by the implementation of the view using the capabilities of the client UI.

Let's see what I want from a client UI:
- using some UI controls to display the information to user, and to collect the interaction of the user
- combining these UI controls to have complex views

Here is my proposal"let's abstract more the UI and define a framework having the following characteristics" :
- define a standard collection of the UI controls(e.g: window, buttons, checkboxes, etc)
- collect the user actions into a Event based manner
- assure a good performance
- native support for MVC

Additionally:
- provide addapters of these abstract framework for:
- desktop clients
- web clients
- mobile clients

Having all of these we get the following:
- reduce the pain of implementing the UI for different types of clients
- reduce the leaning effort


Am I right, or I just start a discussion about another useless Java framework :(?

3 comments:

Unknown said...
This comment has been removed by the author.
Eric Lefevre-Ardant said...

So, you are advocating the use of a small set of common graphics objects that would then use an underlying framework for display.

That's exactly the approach of the Eclipse's SWT, which has apparently been adapted for web display with RAP, as you've noted.

How is your proposition different?

prese said...

I would say more then RAP and SWT.

Why not having an abstract framework letting us defining the UI interface without thinking that the UI is meant for web or desktop.

Having that the change of the client implementation will be really easy and transparent.