Ajax World Conference - Day 1
19 03 2008I’m in New York City attending the Ajax World conference. It feels so great to be in New York. I love coming here.
Today was the first day of the conference and it only lasted half a day, with four 45 minutes sessions. There are a total of 6 tracks so there were a 24 sessions to choose from today. It’s not easy to make a selection since many of them sound very interesting. Nevertheless, I picked my sessions carefully and really enjoyed the ones I attended.
Session 1: Picking the Right Technology for Enterprise Rich Internet Applications
The first talk that I attended was from Yakov Fain, entitled “Picking the Right Technology for Enterprise Rich Internet Applications (RIA)”. Yakov’s talk was a survey of the top technologies to build RIAs. The main contenders in this area are:
- Ajax
- Microsoft Silverlight
- Adobe Flex/Flash
- Sun’s JavaFX
Yakov started by identifying the qualities that an RIA technology should share to be successful:
- seamless deployment on the client
- high penetration rate of the runtime environment
- web browser independence
- fast client-server communication protocols
- robust security
I found it rather ironic that during the first five minutes of the first session I am attending at Ajax World, the speaker said “Ajax is no good.” What Yakov meant when he said that Ajax is no good is that it is difficult to build Ajax applications due to cross-browser compatibilities. Javascript developers have to spend a lot of time writing code to deal with these issues (or use a framework such as Prototype or jQuery). Ajax’s communication protocol (HTTP) is also not the most efficient.
On the other hand, Silverlight/Flex/JavaFX all run in a Virtual Machine (VM) so the environment will be the same wherever the code is deployed, which makes it easier for the developers. Yakov believes that this is where the future lies: to have a small VM deployed on the client. The availability of the runtime is crucial for user adoption and this is why Adobe has the edge currently since Flash Player 9 is installed on more than 90% of PCs in the world.
The current trend is to have a declarative GUI programming language backed by another language, such as the following combinations: MXML/ActionScript, JavaFX/Java, XAML/C#. Yakov believes that Flex is the better technology today, that Microsoft will catch up next year with Silverlight and that Sun still has some work to do before JavaFX becomes stable and competitive.
There is an interesting competition between Microsoft and Adobe. Adobe already has a crowd of loyal designers that are used to their product and they are trying to get the developers to join them. On the other hand, Microsoft has a stable base of developers as customers, and needs to get designers to buy their products. They’ve released Microsoft Expression with that in mind.
Here is a rundown of the characteristics, pros and cons of each technology, as discussed by the speaker.
Ajax:
- Pros:
- No deployment
- 100+ frameworks
- Free, open-source
- Cons:
- Web browser dependency
- 100+ frameworks (how do you choose one?)
- Expensive and long development life cycle
JavaFX:
- Script and mobile
- uses Java Swing 2D APIs
- plugins for Netbeans and Eclipse exists
- Java 6 Update N will be released soon. It is a small VM to deploy in the browser.
Silverlight:
- Pros:
- supports up to 720p-HD video through the web browser
- Silverlight 2.0 runtime is 4.3 MB: fast installation
- Cons:
- no protocols faster than HTTP
Adobe Flex:
- MXML: an XML-based declarative programming language for creating GUIs
- ActionScript 3.0: object oriented language similar to Java
- Flash Player 9: VM that runs swf files
- WebOrb: lets you serialize C# objects to send to Flex UI (so one can use Flex with .NET).
Yakov demonstrated a couple of RIAs that he developped with Flex and they were very impressive, particularly a financial analysis application.
Session 2: Performance tuning Ajax applications
Bob Buffone presented on improving the performance of your Ajax applications. The first half of his talk was very familiar to me, having read ‘High Performance Websites’ from Steve Souders. I highly recommend reading it if you are building web applications. Bob went over a few of the 14 rules for performance improvements mentioned in the book, in particular:
- Tips to reduce the number of HTTP requests
- Tips to reduce the size of HTTP responses (JS and CSS files)
- minification with tools such as YUI ycompressor, dojo toolkit, jsmin, etc…
- gzip can drastically reduce the file size.
- coding style: he advocates changing the coding standards when writing Javascript to produce smaller files. For example, write single line if/for statements without {} since they are optional.
After that, Bob went on to cover lower-level optimizations in Javascript:
- DOM Parsing: do not write your own parser. Use the native parsers and use JSON over XML if you can because it is faster to parse.
- DOM Searching: be careful how you search the DOM. Most frameworks, such as prototype, have optimized code for DOM Searching so use them.
- DOM Creation:
- the innerHTML way: it’s fast and the code stays small but it can get very messy. Also, javascript string concatenation is slow. That’s why in the YUI framework, instead of using JS concatenation, they create an Array of string which they later join. Bob said he benchmarked this and that the Array join technique is only faster in IE 6. In newer browsers, it no longer makes a difference.
- Tail recursion: using createElement to create the DOM objects.
Bob then started covering other types of optimization and showed benchmarks for some of those. They can be found here.
Some members of the audience were not agreeing with him on these micro-optimizations and it started a discussion on premature optimization versus code readibility and maintainability. I agree with some of the members in the audience. While it is great to know some of these low-level optimizations, I do not think that one needs to apply them for every single line of code, before even knowing whether or not this will be a bottleneck or performance hog. If you are gonna call that line only once, why go through the trouble of optimizing it. If it happens that you will call it thousands of time, then you can always go back and make it faster.
Session 3: RIA Approach for Web 2.0 Development Using jMaki
I’ve been subscribing to Arun Gupta’s blog for a while now. I started following it because of his posts on Rails and JRuby but started learning more about NetBeans, Glassfish and Jmaki thanks to him. jMaki is a very cool idea and I hope that it keeps growing. The j in jMaki stands for javascript and the Maki from Makisushi. Essentially, jMaki is a set of wrappers around javascript libraries such as YUI, Dojo, EXT JS, Scripaculous, Google Maps, etc…It makes it really easy to use components from these libraries if you are using Netbeans or Eclipse. All it takes is a drag-and-drop to have a widget on your page such as a Google Map, a YUI table, an accordion, etc…
Everytime I see someone use NetBeans 6, I’m reminded of how cool this IDE is and I tell myself that it is about time I start using it. With jMaki plugin, Netbeans is even more powerful and you can create great mashups in an instant.
Arun’s presentation had a lot of demos. One of them was demonstrating how to use jMaki with Rails while others showed how to use jMaki with JSP pages.
You can learn more about jMaki by going to jMaki.com and by reading Arun’s blog. He has some good screencasts showing how to get started with jMaki.
Session 4: RIA Development on the Microsoft Stack using Flex.
For the last session of the day, I went to see Mike Grushin talk about his experience using Flex with a Microsoft .NET stack on the server. Mike decided to use Flex with Microsoft because he came from Microsoft and was familiar with their technologies.
Mike started by describing what he calls a rich experience:
- responsive, friendly, interactive
- asynchronous communication with server: less full page reloads
- synchronous (text, audio, video)
- attractive UI
Mike’s talk was similar to my first talk of the day. He had a comparison of the four main contenders in the space: Silverlight , JavaFX, Ajax, and Flex. He came to some of the same conclusions as Yakov. Today, the Flex world is the place to be. JavaFX doesn’t have enough momentum and is not ready yet. Pay attention to Microsoft Silverlight.
After this overview, Mike focused his talk on using Flex with .NET. First he compared the different ways that the UI can access server-side data with Flex:
- HTTPService for XML/Text
- Plus:
- No extra server components
- Ability to monitor download progress
- Asynchronous
- Cons:
- HTTP Overhead
- XML Overhead
- Serialization/Deserialization of objects
- Duplicate model object on server and client
- Plus:
- WebService for SOAP messages
- pretty much same pros and cons as HTTPService
- RemoteObject: AMF
Mike blogs at blog.grushin.com and is a founder of feedbackfx.com.
Since Mike finished his talk a little early, I caught the end of the Silverlight presentation that a Microsoft employee was giving next door. It looked interesting and I look forward to learning more about Silverlight during the remainder of the conference.
The main lesson learned during the first day of the conference is that I really need to start looking at Flex and Silverlight. I’ve been focusing on learning and improving my Ajax skills but have paid very little attention to these other technologies. I will spend some time on them from now on. I particularly want to take a deeper look at WebORB.
Categories : .NET, Ajax, Flex, Silverlight
