Home  >  

Why Mozilla Deserves Our Attention - Part 2

Author photo
| | Comments (4)
AddThis Social Bookmark Button
mozilla.png
In the first part of this series I gave an introductory look at Mozilla, and started to answer the statement posed in the title. In this article we'll look at the various RIA technologies and runtimes that Mozilla has to offer. First we'll look at the building blocks, or what one would use to build applications. Then we'll look at runtimes, what you use to run your applications.


Does Mozilla have any RIA Technology?

By default, as a browser, Firefox's great support of the latest web standards such as HTML, JavaScript, and CSS definitely fall into the category of RIA technologies, especially when used with Ajax techniques.

There is a new type of RIA that has come on the scene though. This is one whose host isn't the web browser, but the user's desktop, via a runtime layer. An example of this type of runtime is Adobe AIR. This is the area where I believe Mozilla has the most value to offer RIA developers: Internet desktop applications.

Building Blocks 1: HTML, CSS and JavaScript

In the classic web application browser context, Mozilla's strengths with these technologies is often of more value to library developers, rather than to application developers. But if you are treading water in the sea of Ajax libraries, then hopefully you are benefiting from Firefox optimizations without even realizing it.

Now if we put these in the runtime-specific context, you have a lot as an application developer to work with! The Gecko engine's advanced support of these standards, including the latest versions of ECMAScript, the Midas Specification, and new features such as E4X enable developers to look at JavaScript in an entirely different light.

Building Blocks 2: XUL, XBL, and XPCOM

XUL Planet describes XUL very nicely and succinctly :

"The XML User Interface Language (XUL) is a markup language for describing user interfaces. With XUL you can create rich, sophisticated cross-platform web applications easily."

If you're a Flex developer, and used to working with MXML, then XUL will come very easily. You'll instantly be familiar with frequently used elements like hbox and vbox. When other options for creating advanced rich interfaces are HTML and inconsistent Ajax libraries, XUL can give you the flexibility and tools you need to do more, better. Review the XUL element reference to see all of the native elements available.

XBL is the XML binding language. In combination with JavaScript, XUL, and CSS, this allows you to create reusable components that you can compose in your XUL interface as a single element. Very powerful for modularizing your application, and taking advantage of the DRY principle. Again, Flex developers will understand the benefits of this way of developing, and be familiar with it.

XPCOM stands for "Cross Platform Component Object Model". These are reusable components exposed by some of the Mozilla runtimes. They can be built in a number of languages including JavaScript, C, C++, and Python. The native set of XPCOM objects expose a plethora of functionality, including clipboard, drag and drop, offline storage, and native File I/O support. For a listing of everything the native set covers, check out the latest XPCOM reference.

The Runtimes

Now that you have an overview of what you can use to build applications with, we'll look at what you can run them on. There are really three main ways to run Mozilla-powered applications: Firefox, Prism, and XULRunner. (There are also Thunderbird, Seamonkey, and third-party applications, but we won't cover those here.)

The first one we'll get out of the way is Prism. As I mentioned in the previous article, Prism is really a way to retrofit existing web applications with basic desktop functionality. This is very intriguing, and will be useful for a number of use cases. There are plans to augment the out-of-the-browser functionality, but this is still in the realm of augmenting existing web applications. If you are looking for a runtime to build full-featured RIAs on, and designing the experience from the ground up, this wouldn't be it.

Next is Firefox. But wait a minute, Firefox is a browser, not an RIA runtime, right? Well Firefox contains all of the building blocks mentioned in this article, and it also contains an outlet for them: Add-ons. The Firefox Add-ons (or extension) platform is a great way to build rich application functionality using Mozilla technology. Of course this is in the context of a browser addition, so therefore the best Add-ons typically tend to go hand-in-hand with enhancing the browsing experience, or providing useful bits of functionality as a utility. Firefox has one valuable designation though: It's an official, shining, glorious... Mozilla product. More on that in the next article.

Lastly we have the one I believe has the most potential for building RIAs and internet desktop applications, and that is XULRunner. From the Mozilla developer website:

"XULRunner is a Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications that are as rich as Firefox and Thunderbird. It will provide mechanisms for installing, upgrading, and uninstalling these applications. XULRunner will also provide libxul, a solution which allows the embedding of Mozilla technologies in other projects and products."

Prism is itself built on XULRunner, and Firefox 3 is pretty much built on it as well.
Despite comparisons between Adobe AIR and Prism, XULRunner is really closer to a competitor to AIR.
There is a lot of confusion when it comes to XULRunner and what it means to build an application with it. To clear things up, you don't need to come anywhere near the Mozilla build system! In fact you don't need to compile anything at all. Getting a XULRunner application bootstrapped can be a hurdle however.
If you ever find yourself wishing that you could integrate an Adobe AIR application with native code, or launch external processes, XULRunner can do that and more.


Got RIA? Yes.

We've seen in this article that Mozilla has a number of technologies and runtimes that can be valuable in creating rich applications, whether they live in the browser, or on the desktop. I want to make sure I'm not glossing over some important considerations though. In the last part to this series I will highlight a few of the challenges that one should be aware of that Mozilla technology is facing. I will also try and offer some suggestions that could make the decision of whether or not to build your RIA with Mozilla technology a no-brainer.

Read more from Ben Longoria. Ben Longoria's Atom feed enefekt on Twitter

Comments

4 Comments

Andy Edmonds said:

It's great to see content on Mozilla @ InsideRIA.

An important recent development in the mozilla space is the FUEL library for the upcoming Firefox 3. It offers some insulation against the rapid internal code evolution of the open source world for accessing the amazing Places data-store of bookmarks, history, and annotations / tags, as well as preferences, tabs, and storage. http://developer.mozilla.org/en/docs/FUEL


Ben Longoria said:

Thanks Andy! Yes, FUEL is cool. Another JavaScript library that is geared towards making it simpler to use some of those Mozilla APIs is jslib:
http://jslib.mozdev.org/

skierpage said:

Besides Flock, http://www.mozilla.org/projects/mozilla-based.html lists other XULRunner-based apps (Joost, Miro, Open Komodo, Songbird, etc.).

One interesting and unheralded advance is that Firefox 3 has a command-line switch to run any XULRunner app. `firefox.exe -app \path\to\XulApp\application.ini` That could permit extremely lightweight distribution of XULRunner apps (no multi-MB runtime required by anyone who has Firefox 3) and I think shares the runtime in memory.

Ben Longoria said:

Thanks for listing those apps skierpage. I started to get link fatigue when writing this, and wanted to link to all of those, but didn't get to it. (I think Songbird is pretty rad)

As far as the command-line feature, I address this general subject in the last part to this series. Keep your eyes peeled, should be up today!

Leave a comment


Type the characters you see in the picture above.

Tag Cloud

Poll: Sci-Fi Movies

What's Your Favorite Sci-Fi Movie of All Time?

Vote | View Poll Results | Read Related Blog Entry

Latest Features

  •     Welcome back to the series. This time we are goings to build a really exciting component that will be used to simply display information about the user. Well, you might say why to we need such a component, is there... Continue Reading
  •    Welcome back to our exciting Facebook ActionScript series. In this article we will discuss one of most important (and most exciting) features of the FB platform, it's the publishing of news. We all know when we log in to facebook,... Continue Reading
  • This article provides 10 tips and best practices (in no particular order) for maximizing the benefits that Dojo can bring to your next project. For a more thorough introduction to Dojo, see the article Dojo: The JavaScript Toolkit with... Continue Reading
  •     The notifications are one of the most interesting (and important) parts of the facebook area. In order to completely understand the Flash side of it, we need to understand the basics of the facebook notification, what it is and how... Continue Reading

Development Series

Get an overview of the tools and technologies that work together to allow developers to build Rich Internet Applications (RIAs) quickly and easily.

facebook icon Facebook Application Development

Anatomy of an Enterprise Flex RIA

Recommended for You

@InsideRIA on Twitter

Archives

  • Or, visit our complete archive.  

About This Site

Welcome to the premiere community site for all things RIA sponsored by O'Reilly Media and Adobe Systems Incorporated.