Pathfinder Blog
Author Archive: Dietrich Kappe

Making GWT JSON not Quite so Painful

I've been using GWT to resurface interfaces of a variety of legacy applications -- J2EE, PHP, Rails -- and more often than not that means working with JSON returned from the server. One thing that I've found is that GWT's JSON support is kind of chatty. That is, you have to write a bunch of code like this:

JSONValue root = JSONParser.parse(json);
JSONObject obj = root.isObject();
if (obj != null) {
    JSONValue map = obj.get("map");
    if (map != null) {
        JSONArray arr = map.isArray();
        if (arr != null) {
            if (arr.size() > 1) {
                JSONValue strval = arr.get(1);
                if (strval != null) {
                    JSONString str = strval.isString();
                    if (str != null) {
                        String s = str.stringValue();
                        // do something with the string
                    }
                }
            }
        }
    }
}

Yikes! Just to get the string in the second array item in the "map" key of the top level object. Truth is, most of the JSON I'm getting back is fairly predictable. And if it's not in that predictable form, it's an error that the client code can't recover from. I'd like to be able to write something like String result = obj.get("map").get(1).stringValue() without having to worry about NullPointerException's cropping up all over the place.

Continue reading »

Topics: ,

Microsoft to Jump on Board EC2

Hold on to your hats; Microsoft has just made a radical change in business model. A couple of months ago I wrote about the competitive advantage that firms using Linux and Amazon's EC2 cloud computing had over their competitors.

Server-on-demand providers like Amazon's EC2, Joyent,
and others have reduced the capital necessary to launch scalable,
server intensive businesses. Google has just launched a similar
on-demand service, and companies like RightScale and CohesiveFT are building mature businesses around managing EC2 configurations.

...

Facebook applications are just the most extreme example of business initiatives that can be scaled on demand from $70/month on one EC2 server to $10,000/month on many dozens of servers running web, application and database server clusters and farms. Compare that with the old school of investing in a large data center with a significant fraction of the hardware and bandwidth that you might need if your business is a success. What used to cost $100k in capital can now be done with just a few hundreds of dollars.

...

And it's all possible as long as you are using a unix variant - Linux for the most part - to power your apps. So there is a whole class of companies out there using Linux that can out compete their Windows-using rivals - again, the capital they need to launch is much smaller because of cloud computing. That means Linux will win among the class of young entrepreneurial businesses that are so vital to the US economy.

Continue reading »

TAE Boston 2008: The Unsexy Presentations

Lets face it, most people come to Ajax conference for the eye candy. TAE Boston 2008 is no different, and the jQuery, Dojo and other sessions are packed. That's great. I love good eyecandy. But the shame is that many folks skip the less sexy presentations, such as today's presentation by Ted Husted entitle Ajax Testing Tool Review. Talks like these and the tools and methods they discuss is what is leading to the "professionalisation" of front end development, as my colleague Brian Dillard likes to say.

Some of the highlights from Ted's talk:

  • If you like CruiseControl, but it's too fiddly for you, you'll love Hudson, a much more user friendly continuous integration engine.
  • The Selenium IDE is great for getting started or smoke testing, but use the API's (in Java, C#, Ruby, etc.) to get real, supportable unit tests done.
  • YUI Test is intrusive, but it overcomes some of the shortcomings for testing asynchronous events that are present in JsUnit and Selenium. See Ted's post on YUI Test.

OK, not sexy, but if you want to develop quality software, you have to keep an eye on the non-sexy bits.

Betting Your Business on the iPhone

Monopsony - the market condition that exists when there is only one buyer.

iPhone in DockWe all have heard the term "monopoly" and even know a little bit of what it means - a market where there is only one seller. But the related term "monopsony," a market where there is only one buyer, is not as well known and it's dangers not as well understood.

Certainly both monopolies and monopsonies will reduce competition, innovation and consumer choice, but they further constitute a big risk for the sellers. For businesses on the seller side a monopsony can be the kiss of death. Just ask Walmart's suppliers how good it's been for them.

Not all monopsonies are as obvious or as overtly damaging to suppliers as that of Walmart, but Apple's iPhone and iTunes appstore looks like a benign monopsony. A monopsony in that although the iphone consumer is the ultimate buyer, Apple determines what is permitted in it's appstore, and benign in the fact that Apple hasn't flexed that restrictive muscle more than a few times.

Continue reading »

Topics: ,

GWT Tutorial - Building A Model

Shalk Neethling has written up a nice, streamlined tutorial on how to build a model in GWT using the GWTx project's support for java.beans.PropertyChangeSupport.

The basic idea here is that while the browser is the View and the server side is the Model and Controller in MVC, you really should structure your browser side code as an MVC itself where only the Model interacts with the server.

Well worth a read.

Topics: ,

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

Porting Java Libraries - Jazzed About GWT

I've been building GWT interfaces for a while now, and it's been pretty cool. My attrophied Swing skills are slowly coming back and the kinds of stuff I've written has been leagues beyond my early Ajax stuff. So far so good.

Throughout it all, I've been trying to obey my own principle of avoiding leaky business logic and sensitive data. That means that most of the heavy lifting, business logic wise, happens on the server side.

This past weekend, however, I got a rare chance to do some programming for myself. One of my hobbies is chess, and I've written a few programs over the years to help me study and analyze the game. Right now I'm putting the plumbing together for a web/iphone application site. I've got all the stuff that handles FEN, move generation, PGN and UCI (interfacing to chess engines) on the server side, and the application side is mostly concerned with board displays.

Continue reading »

Topics: ,

Startups, Software and the Vision Thing

If you can dream it, you can do it.

-- Walt Disney

You have a great idea, an idea that is going to transform an industry. You've turned a venture capitalist's head with your presentation and now you just need a software development firm to translate your vision into reality. This is where the trouble starts.

If you move in startup VC circles, you see enough of these deals go sideways or never get off the dime. Investors see hundreds of thousands or millions of dollars plowed into software development without a usable product or service coming to light. Fingers are pointed; tears are shed. For every success there are a half dozen failures. Why is that?

In my experience it all comes back to that word, "vision" as in "translate your vision into reality." What the heck is vision? If you've ever cracked a book on software project management (or just general project management), there's usually a section about having a project charter and a vision statement. As a young developer I would wince and turn to the next chapter. After all, I thought, isn't vision the same thing as what you're going to build? Isn't scope or, more basically, a list of things your are going to build, the same thing as "vision?" Why blather on in consultant speak about vision statements when a more concrete and practical project description could be had?

Continue reading »

IE8 Beta 2 Released

I like it. Give me more browser improvements! With the news of Firefox 3.1's JIT JavaScript beasty TraceMonkey, is it too much to hope that IE8 Beta 2 has some similar improvements under the hood?

First you have to find the appropriate page among the 300 or so flogging IE8 Beta 2 in the MS redundaverse. Drilling down into performance, you find the terse:

...the script engine in Internet Explorer 8 is significantly faster than in previous versions, minimizing the load time for webpages based on JavaScript or Asynchronous JavaScript and XML (AJAX).

OK. Faster. Faster how? How much faster?

It used to be that JavaScript engines were so slow that benchmarks served mostly to show that they weren't suitable for anything serious (slow and slower). It's time for some head-to-head benchmarks. Stay tuned.

Topics: ,

Faster JavaScript for Firefox 3.1 Thru JIT

I was expecting the next major advance in JavaScript for Firefox to come from replacing SpiderMonkey with Tamarin, Adobe's donated VM for ECMAScript 4. In fact, Tamarin can already do some JIT.

Now surprise, surprise -- SpiderMonkey can do JIT as well, as Brendan Eich, Mozilla's CTO describes in his blog. The technique used in both Tamarin and SpiderMonkey is called tracing, where during code execution, each hotspot (code that is executed a whole lot) is traced and compiled, so the next time it is executed, the compiled version is used. The beasty is called TraceMonkey and boasts several orders of magnitude improvements over the old SpiderMonkey.

Since this JIT involved actual compilation, you have to look at which architectures TraceMonkey supports. Again from Brendan's blog:

We have, right now, x86, x86-64, and ARM support in TraceMonkey. This means we are ready for mobile and desktop target platforms out of the box.

Sweet. I guess that means the Intel Macs are supported.

There are still some bugs, of course, but this is great news for sophisticated Ajax apps on Firefox. Will Microsoft respond? Is a JavaScript JIT upgrade in the works for IE? This is an arms race I can get excited about.

Update: John Resig of JQuery has some more details and demos about TraceMonkey.

Why Chicago is Rails-town, USA

It's rare that dowdy old Chicago can pull rank on Silicon Valley, but with the red hot Ruby on Rails technology, Chicago leads the pack. How can I make such a claim? After all, everyone knows that SF and San Jose and points in between attract the best developers. There are 7 (and counting) reasons why I can say this:

  1. 37Signals - yes, the company where it all started is headquartered in Chicago. They're out of the professional services business and selling software built in RoR, but we used to see them as a competitor and have tried to emulate some of their business plans.
  2. Pathfinder Development - yes, the small but growing RoR powerhouse is also headquartered in downtown Chicago. They combine Agile development, User Experience Design (UXD) and RoR to develop "extraordinary applications," as it says in the tag line to the right. :-) Watch for our Rails-based competitor to Mingle, Tasker, in the next few months. Of course we also have Noel Rappin, author of Professional Ruby on Rails.
  3. ThoughtWorks - global IT consultancy, but an OO and Agile Rails development shop at heart. Their Agile project management product, Mingle, is implemented in Rails.
  4. Centro - they're all Rails, all the time. Their core business is "providing the most comprehensive platform and services to help agencies easily and effectively buy local online media," but they have an impressive team of Rails developers powering their development. Heck, they're just a handful of blocks from us. We may have more Rails developers per square mile than any other neighborhood in America!
  5. WindyCityRails - our own local Rails conference (yes, we sponsor it).
  6. Two, count'em, two active Ruby groups, ChicagoRuby.org and the Chicago Area Ruby Group.
  7. Obtiva - another Agile and Rails shop, this one in the suburbs.

Think your town deserves the title of Rails-town USA? Bring it on!

Restlet Ported to GWT

If you want to communicate with the server in GWT, you have GWT-RPC and you have JSON (and in fact a few different flavors of JSON). If, however, you pine for the elegance of a RESTful interface, you've had to roll your own.

Now the folks at the Restlet project have ported the Restlet API to GWT.

Thanks to the support for generics in GWT 1.5 RC1, we were able to achieve this port with reduced efforts and limited troubles. We had to get rid of the server-side features that don’t make sense in a browser, and of the APIs like NIO and logging that aren’t emulated by GWT. The major impact was the adaptation of the API to the asynchronous communication imposed by AJAX and GWT.

So now you can make much easier use of RESTful back ends. If you've been working with Rails or Grails, you won't have to ask why RESTful backends are good. If you want a quick intro to Restlets, see this quickstart.

Topics: ,

MetaWidget - Convention over Configuration UI

I already know that I'm not going to do MetaWidget justice as I describe it. What the heck is it? According to the MetaWidget site, it is...

Metawidget takes your domain objects and automatically creates User Interface widgets for them, saving you handcoding your UIs and leaving you to concentrate on stitching together your application.

Think of a configurable form widget driven off of your beans through runtime inspection of properties, getters and setters, annotations, etc.

But wait, there's more. It automatically detects your backend at runtime and makes friends with Hibernate, Spring, Seam, Groovy, etc.
Continue reading »

That’s “Tyre” with a “Y”

The self licking ice cream cone that is blog awards has dripped on Agile Ajax. We've gotten a nod from Computer Weekly for the IT Blog Awards 08 as one of the best programming and development blogs. Funny thing, it's a list for the UK, and we've got offices in Chicago and New York.

To curry favor with the voters, we'll start blogging about tyre's and setting colour in CSS. What is it they say? Two peoples divided by a common language?

Anyhow, the self licking ice cream cone part. Go and vote for your favorite. Unfortunately, since we didn't make the short list, you can't stuff the ballot box for us.

Topics:

GWT IDE Goodness

When GWT 1.5 came out, there was a real deficit amongst the IDE's -- all of them were still in 1.4 land. Well, the situation looks a little brighter today.

  • First, there is GWT Tooling, a plugin for Eclipse that is supposed to ease development of GWT applications with Eclipse.
  • Next, the folks over at Google are themselves working on their own Eclipse plugin. It's not ready yet, but you can see a presentation from the end of June by Bruce Johnson showing off some the GWT Eclipse plugin's features.
  • The latest Cypal Eclipse plugin for GWT is supposed to work for GWT 1.5. Haven't tested it myself yet.

On the disappointment side, Jetbrains looks like it's releasing support for GWT 1.5 in it's 8.0 release. Having to wait for a major IDE release for a plugin upgrade is kind of lame. :-(

Topics: ,

About Pathfinder

  • We design and build extraordinary applications for companies looking to make the next great idea a reality.
  • learn more

Topics

WordPress

Comments about this site: info@pathf.com