Topic: Ajax Frameworks

Making Vaadin, PureMVC and Grails Work Together

On seeing that someone had developed a Grails Plugin for Vaadin (the former ITMill Toolkit, based on GWT as a front end technology), I immediately grabbed it and started exploring. One of the first things I do when developing things that look like GUI's is apply PureMVC to it. It's sort of like a big MVC switchboard that lets you hook together the smaller MVC's of whatever framework you're using. Overkill for really simple applications. Crucial for big ones.

Building a PureMVC app was pretty quick, but I ran into a small problem. Since PureMVC Multicore uses a Multiton pattern (essentially a map of Singletons), when Grails recompiles and restarts on code changes, the application barfs with a "Facade already constructed" runtime error. The solution is simple. In your subclassed org.puremvc.java.multicore.patterns.facade.Facade, change the following:

  public static ApplicationFacade getInstance() {
    if (instance == null) {
      instance = new ApplicationFacade(CORE)
    }
    return instance
  }

to this:

  public static ApplicationFacade getInstance() {
    if (instance == null) {
      // nuke the multiton so we can do the grails recompile
      if (ApplicationFacade.hasCore(CORE)) {
        ApplicationFacade.removeCore(CORE)
      }
      instance = new ApplicationFacade(CORE)
    }
    return instance
  }

And voila, your app now recompiles and runs without a hitch, just like a Grails app should. (CORE is a string constant to name your core.)

Related Services: Java Application Development, Custom Software Development

IT Mill Toolkit 5 out of Beta

itmill_logoWith the release of IT Mill Toolkit 5.3.0, the server-side RIA framework is now ready for production. I announced the initial release of 5.0 back in December of 2007. Since that time, IT Mill 5 has gone through several revisions and the release of GWT 1.5 (which means you can use Java 5 now on both the client and the server). As a reminder, server-side RIA frameworks let you write your app completely in the server and uses a client-side Ajax engine to render the interface. The nice wrinkle with IT Mill is that both the server side and the client side are written in Java, so if you want to add a component, you don't have to break out the JavaScript (see the extensive and high quality reference manual for details on how to develop your own custom components in GWT). If you're a Java shop, that's got to be a good thing.

ZK 3.5 Released with Comet Support

ZK 3.5, the latest version of the server-side Ajax framework, is out with a raft of new features. Three of those features really stand out for me:

  • Comet server push
  • Customization of look and feel
  • Performance monitoring

Server push via polling has been available in ZK for a while, and Comet in the ZK "Enterprise Edition," but now it is available to everyone. And it is pretty easy to use: "The implementation of server push is transparent to developers. ZK chooses which implementation to use according to the edition of ZK automatically, but it is configurable."

Customization of look and feel has gotten much easier. ZK has followed the example of a number of other frameworks in styling its widgets with predictably named CSS styles. Changing the look and feel of an application is now as easy as changing the ZK widget style sheet. Styles can further be overridden on a widget instance-by-instance basis.

Performance monitoring is perhaps the most exciting new feature. Client-side tools such as YSlow can guide optimization efforts and give you point in time performance snapshots. But critical applications need to be monitored and tracked end to end over their lifespan. With ZK 3.5, you now have the plumbing to instrument your application to capture five data points for each request:

  • T1, the time browser sends a request to server
  • T2, the time server receives a request
  • T3, the time server sends a request to browser
  • T4, the time browser receives a request from server
  • T5, the time the browser finishes processing a request

ZKStudio 0.8.2

There's also a new version of ZKStudio for Eclipse out. The major change is that it now supports auto update via http://studioupdate.zkoss.org/studio/update

Ext JS: License Troubles with Their Use of YUI?

extjsIn this little post, Eric Miraglia of the YUI team points out that Ext JS' recent change from LGPL to GPL and their inclusion of some YUI code without including the text of the YUI license (BSD) may violate the terms of that license.

I don't think this is a serious infraction, but it does point out how important good will and amicable relationships are between open source projects that violate one another's licensing terms all the time.

MooTools 1.2 Released

Mootools 1.2 has been released. Right now the site seems to be hammered, and there don't appear to be any release notes. More as I find it out...

A Quick Look at the New GWT “Themes”

One of the welcome developments in GWT 1.5 was the inclusion of some decent looking CSS themes -- standard. chrome and dark.

How can you use them in your GWT app? Just include one of the following lines in your apps .xml file:

 

You can see them in action in the ShowCase application. For those of you without the patience to kick start the app, here are some screenshots of the new themes:

Related Services: Ajax Rich Internet Applications, Java Application Development, Custom Software Development

Topics: ,

GWT 1.5 RC1, Getting Closer

I've been working with GWT 1.5 out of the source repository for a few months, so the release announcements for GWT 1.5 kind of went by unnoticed. But now it's getting serious. GWT 1.5 Release Candidate 1 is out, which means that GWT 1.5 is soon to follow and everyone will soon be enjoying the benefits of 1.5 that I've been relishing for a while. What are some of those benefits?

Continue reading »

Topics: , ,

jQuery Release 1.2.6: Performance Improvements and Dimensions Plugin Added to Core

A new release of jQuery is out -- 1.2.6, skipping directly from 1.2.3. Most noteworthy are the performance improvements (you can check out the detailed performance data via this Google Spreadsheet). The headlines on improvements:

  • Event handling: 103%
  • CSS selectors: 13%
  • .offset: 21%
  • .css: 25%

Lots of other fixes, but the most important, IMHO, is the inclusion of Brandon Aaron's Dimension's plugin -- cross browser support for find element dimensions, offsets and positioning -- in the jQuery core. Check out the release notes here.

HTML5 custom data: A possible savior for the poor, overloaded class attribute?

The HTML5 custom data proposal received a lot of attention last month, but I forgot to post about it during my preparations for Web 2.0 Expo. Reviewing the proposal now, I'm excited all over again. After doing lots of jQuery work lately, I'm sick and tired of the poor HTML "class" attribute getting used and abused for unobtrusive JavaScript. I think HTML5 custom data gives us a graceful way out.

Overloaded

First, a little background. Simon Willison, as usual, boils the issue down to its essence, succinctly quoting the proposal and nailing its implications in two sentences:

"Every HTML element may have any number of attributes starting with the string 'data-' specified, with any value." [T]his will be incredibly useful for unobtrusive JavaScript where there’s no sensible place to store configuration data as HTML content. It will also mean Dojo has an approved method for adding custom attributes to declaratively instantiate Dojo widgets.

For further background, including great debate in the comments, check out these blog posts and official documents:

If you've never used custom properties (sometimes known as expandos) on your HTML elements, it's worth looking at how the technique has evolved over time. (Old pros can stop reading here.)

Continue reading »

My IBM developerWorks series, part 2: Tooltips, lightboxes and more jQuery goodness

IBM developerWorks recently published my second "Ajax overhaul" tutorial. This series teaches intermediate-level developers how to layer Ajax features atop old-fashioned CRUD applications. My colleague Dietrich Kappe calls this the "Christmas tree" approach to Ajax development, and it's a valid choice for many companies. It's not the sexiest take on Ajax, but it often provides a lot of value for relatively little cost.

"Ajax overhaul" tackles a fictional shopping site for its use cases. Each installment examines a particular deficiency in the existing application's user experience and improves it using Ajax and progressive enhancement. Because I focus on the interface layer, the code examples feature only client-side code. I've completed four installments so far, each one employing some combination of jQuery, custom JavaScript and custom CSS.

I previously posted about the first installment. Here's the direct link to the second:

Ajax overhaul IBM developerWorks

Ext JS 2.1 Now GPL (was LGPL)

One thing I overlooked with the release of Ext JS 2.1 is that it is now GPL rather than LGPL. That means that if you build Ext JS 2.1 into your app, it would have to be GPL's if you planned to distribute it. (See this flame thread on the extjs forum).

Not a problem if you are providing a service, but if you are distributing the application, then you are GPL infected.

If we look at part of the GPL v2:

These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.

Now IANAL, but if you distribute a stub application with at least 2 UI implementations that can be downloaded and installed separately, you might be OK. Another argument for designing your applications as service providers that can be accessed by multiple different clients. That way you can change UI frameworks as necessary, such as when your current framework changes open source licenses.

Continue reading »

Recent Ajax Framework Releases/Developments

Some noteworthy Ajax Framework releases have come out in the last few weeks, along with some other news of interest:

  • Ext JS 2.1 and Ext GWT 1.0 Beta - Better performance, new Slider, StatusBar components. REST support (support for other HTTP methods beyond POST and GET). The Ext GWT 1.0 Beta consummates the love affair between GWT (Google Web Toolkit) and Ext that was started by gwt-ext and MyGWT, but provides the comfort of knowing that it is supported by the Ext JS folks. Note: Ext GWT is pure GWT, not an Ext JS wrapper.
  • Dojo 1.1 - First off, API compatibility between 1.0 and 1.1. Unified timing loop (ala Scriptaculous) for animation effects, with increased performance. Syntactic improvements to dojo.query. Unification of XHR functionality into dojo.xhr() function.
  • Backbase Enterprise Ajax 4.2 - Backbase has been in the commercial framework game longer than almost anyone. Among the new features: hierarchical data bindings and improved performance. If you've wanted data binding for tree widgets, have a look.
  • Google Search, Feed and Translation API - I opined a while back that Google discontinued their SOAP search API because they didn't want people reordering or otherwise manipulating their search results. Looking at the terms of use of the new REST service, you can see that this continues to be a concern:  You agree that you will not, and you will not permit your users or other third parties to: (a) modify or replace the text, images, or other content of the Google Search Results, including by (i) changing the order in which the Google Search Results appear...
  • Google App Engine - it only runs Python apps right now, and it's a preview release available to a select few, but you can already see that this is Google's challenge to Amazon's EC2 compute cloud. In at most a year, unless you are security sensitive -- health care, financial services -- or running on Windows, you won't be building and maintaining data centers. The capital requirements for launching sophisticated and scalable online services is about to change.
  • Echo3 (beta) - it's getting close. Superior performance to Echo2. Easier development of new components. Automatic serialization of objects between client and server. All HTML rendering now done on client. Overall the JavaScript client code is now of a design quality on par with the server code.

Lots of exciting developments for Ajax developers and Web 2.0 entrepreneurs. I, for one, can't wait to see how the Google App Engine compares to EC2 for deploying and scaling Facebook applications.

Technorati Tags: , , , , , , ,

GWT 1.5: Get Ready to Fix All of Your JSNI that Uses long

I've been humming along with GWT 1.5, reading the release notes and compiling from trunk. Today I had a nasty little surprise. All of my JSNI code that used long as either a parameter or return value stopped working. So, something like the following...

public native long method(long param) /*-{
   // do something useful
}-*/;

...would throw a nice little exception in hosted mode:

Return value of type 'long' is an opaque, non-numeric value in JS code
Parameter 'value': 'long' is an opaque, non-numeric value in JS code

Continue reading »

Breaking Prototype habits in a jQuery world

Jqueryinaction
When you get used to doing things one way, it's hard to retrain yourself. It took me months to "get" the Prototype way of doing things after a decade of writing all of my own Plain Old JavaScript, sans framework. Now that I'm more likely to use jQuery, I've still got some residual Prototype habits to break.

In Prototype's Enumerable class, you call the each method to iterate over a collection. In jQuery, you can do the same - but you often don't have to. Many of the standard jQuery methods automatically iterate over the member nodes of a jQuery object. There's usually no need to do so manually using jQuery's version of each. My friend and former colleague Zack Frazier reminded me of this fact the other day, in response to this original post. His input helped me fine-tune my JavaScript on the new Pathfinder website.

Compare my original version of this code, which transforms target="_blank" windows into more finely controlled JavaScript popups:

Continue reading »

QWT: Qooxdoo Web Toolkit

Qooxdoo
Qooxdoo is an Ajax framework that I haven't spent much time with, but after meeting the guys of Qooxdoo at AjaxWorld East and finding out that it's pronounced "guckst du," as in the German slang "Was guckst du?" (Rough translation: "What are you looking at?"), my interest has been piqued.

One interesting recent addition to qooxdoo is QWT, the Qooxdoo Web Toolkit, a Java to JavaScript "compiler" that works with the qooxdoo framework. I put "compiler" in quotations because, after looking at the code, it looks more like a Java to JavaScript translator. Also, where GWT has a hosted mode where you can debug in Java, QWT doesn't appear to have that feature, so debugging wonky QWT code promises to be a bit of an adventure.

Still, an community effort of this kind indicates that qooxdoo is a vibrant framework. I intend to give qooxdoo a closer look over the next few months.

Technorati Tags: , , , ,

Launch: Pathfinder Newsletter

    Get a monthly update on best practices for delivering successful software.

    Subscribe via email


    Subscribe via RSS      RSS icon

Topics

Search

WordPress

Comments about this site: info@pathf.com