Feeds

Echo2 versus GWT

Another toolkit that hides AJAX's implementation details

Internet Security Threat Report 2014

A little while ago, I wrote about the GWT (Google Web Toolkit) here, which I'm particularly interested in as it provides a pure Java environment that can be translated into pure AJAX-style code.

This means that a Java developer can work with the GWT and create effective, lightweight, interactive websites without the need to get into how AJAX is implemented.

This column produced a great deal of correspondence from readers, a number of which highlighted other frameworks with similar aims. The Echo2 framework is of particular interest to me, as I've worked with its previous generation system.

In the remainder of this column, I'll briefly introduce the Echo2 framework and then provide a short comparison between GWT and Echo2, highlighting the strengths and drawbacks of the two approaches.

The Echo2 Framework

The Echo2 framework provides a web-based platform offering rich-client levels of capability and maintainability. It's a re-engineering of the previous generation of the Echo framework to take advantage of AJAX in its new rendering engine.

Echo developers create applications using a component and event-based API that resembles a rich-client user interface toolkit (think Java Swing). A rendering engine then generates the AJAX-style code required to render the user interface to the client browser.

To bring the experience closer to the standard of a thicker client, Echo2 uses an extensive library of client-side JavaScript that extends the capabilities of the browser. The architecture aims to remove the need for the end developer to think about the management of HTML, HTTP, and JavaScript, CSS etc. Indeed, the developer is completely insulated from that side of the system.

For further details of the Echo family (including Echo1) see here; Echo2 is here; and for EchoPoint (a collection of web components which integrates with the Echo Web Framework), see here.

Both Echo and EchoPoint are open source. Echo is released as open source by a company called NextApp; while EchoPoint is a collaborative effort coordinated via SourceForge.

The programming model adopted by Echo is intentionally Swing-like (with tables and table models and buttons and action listeners etc.) so that Swing developers should be able to move to Echo with the minimum of problems.

As an example, see the following very simple HelloWorld style Echo application. This application is comprised of two classes. The first is the HelloWorldServlet class. This class acts as an entry point for an Echo2 application. In essence, it's a standard factory that creates a new instance of the main Echo2 application - in the example; this is implemented by the HelloWorldApp class.


package com.reg.echo.hello;

import nextapp.echo2.app.ApplicationInstance;
import nextapp.echo2.webcontainer.WebContainerServlet;

public class HelloWorldServlet extends WebContainerServlet { 
        public ApplicationInstance newApplicationInstance() { 
                return new HelloWorldApp(); 
        } 
}

The main HelloWorldApp class is presented below:

package com.reg.echo.hello;

import nextapp.echo2.app.ApplicationInstance;
import nextapp.echo2.app.Button;
import nextapp.echo2.app.ContentPane;
import nextapp.echo2.app.Extent;
import nextapp.echo2.app.Label;
import nextapp.echo2.app.SplitPane;
import nextapp.echo2.app.Window;
import nextapp.echo2.app.event.ActionEvent;
import nextapp.echo2.app.event.ActionListener;

public class HelloWorldApp extends ApplicationInstance { 
        private Label label = null;
        public Window init() { 
                Window window = new Window(); 
                SplitPane pane = new     
                       SplitPane(SplitPane.ORIENTATION_HORIZONTAL, 
                                                       new Extent(215));
            pane.setStyleName("DefaultResizable");
                ContentPane contentPane = new ContentPane(); 
                contentPane.add(pane);
                window.setContent(contentPane); 
                label = new Label("Hello World"); 
                Button button = new Button("Next");
                button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                                if (label.getText().equals("Hello World")) {
                            label.setText("Hello Echo World");
                                } else {
                                    label.setText("Hello World");
                                }
            }
        });
                pane.add(label);
                pane.add(button);
                
                
            return window; 
        } 
}

Choosing a cloud hosting partner with confidence

More from The Register

next story
Netscape Navigator - the browser that started it all - turns 20
It was 20 years ago today, Marc Andreeesen taught the band to play
Sway: Microsoft's new Office app doesn't have an Undo function
Content aggregation, meet the workplace ... oh
Sign off my IT project or I’ll PHONE your MUM
Honestly, it’s a piece of piss
Return of the Jedi – Apache reclaims web server crown
.london, .hamburg and .公司 - that's .com in Chinese - storm the web server charts
NetWare sales revive in China thanks to that man Snowden
If it ain't Microsoft, it's in fashion behind the Great Firewall
Chrome 38's new HTML tag support makes fatties FIT and SKINNIER
First browser to protect networks' bandwith using official spec
Admins! Never mind POODLE, there're NEW OpenSSL bugs to splat
Four new patches for open-source crypto libraries
prev story

Whitepapers

Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Why cloud backup?
Combining the latest advancements in disk-based backup with secure, integrated, cloud technologies offer organizations fast and assured recovery of their critical enterprise data.
Win a year’s supply of chocolate
There is no techie angle to this competition so we're not going to pretend there is, but everyone loves chocolate so who cares.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Intelligent flash storage arrays
Tegile Intelligent Storage Arrays with IntelliFlash helps IT boost storage utilization and effciency while delivering unmatched storage savings and performance.