Testing XUL applications

Thursday, December 29. 2005

There are various ways to test applications. For GUI applications, you have the following options:


Continue reading "Testing XUL applications"

Logging in XUL

Thursday, December 29. 2005

Regarding this post, I need to point out that logging in XUL-based applications is much simpler. Using Mozilla's console service, you can directly write to the Javascript console. We have made the function logMessage available through an interface which can also dump JS objects (=arbitrarily complex/nested arrays), so that printf-style debugging becomes extremely easy with Mozilla. On top of that you can also dump the JS callstack which helps tracing down issues. Hopefully the Ajax world will gain something equally useful at one point in time.

Under chrome's influence

Tuesday, December 27. 2005

Many people are not aware of what chrome actually is. I'll try to explain here what it was originally intended for and how you can exploit it for your own applications.


Continue reading "Under chrome's influence"

Sixt does XUL

Friday, December 23. 2005

Germanies largest car rental company with one billion Euro per year in total revenue, uses XUL for all new software.

In this article in Computerwoche (German) the head of IT describes their success in combining Cobol, PHP and XUL.

XUL vs. AJAX

Thursday, December 22. 2005

How do these two relate?

They share several aspects.

- implemented in Javascript
- asynchronous client-server communication
- data might be transmitted in XML
- extensive client-side data validation
- rich user interface
- no history model (back/forward button)

Major distinctions:

- AJAX is part of the view -- and thus eye candy in most cases.
- AJAX aims at being cross-browser compatible.
- XUL can contain model, view, controller.
- XUL has full access to the user's system including local files. **
- XUL can be stand-alone. An application server is optional.
- XUL has a richer widget set compared to HTML.
- XUL can connect to databases directly.

Or in other words, you can write a full, self-contained application using XUL. In the simplest case, the appserver will only execute SQL queries. Or you could even use the SQL Mozilla extension for accessing a local SQLite database and thus create stand-alone applications.

** Note that I don't care about remote XUL. Our apps always have the XPConnect privilege.

R.I.P. XULMaker

Thursday, December 22. 2005

One of the selling points of XUL was creating user interfaces visually.

The most advanced implementation of that idea was XULMaker. Unfortunately, that project has not released anything for well over a year.

I shall therefore pronounce it dead. Requiescat in pace, XULMaker.

Oh, and btw. The loss is not that huge. Writing XUL using an XML editor is the choice of many developers. The hard part is coding the logic, not the presentation. Nonetheless, it was an important selling point.

Alternatives?

Business logic

Thursday, December 22. 2005

Where goes the business logic?

That depends on two factors: Where the application runs and by whom.

In the open world (think of public web sites like Gmail), you won't be able to put business logic (aka the model) on the client for obvious reason (mostly security and intellectual property).

The problem you are faced with is that your programmers have to switch between two implementation languages. On the one hand, they need to develop in a server-side language (such as Java, Ruby, Python, PHP). On the other they need to deal with often vast amounts of Javascript.

If you target older web clients, your application might even need to degrade smoothly (being non-Web2.0ish). Which means that your developers will have to implement features twice. Once on the server, once on the client. With the beautiful side effect of increasing testing complexity exponentially.

However.

In closed corporate environments you can often define new rules. Take this customer, for example.

- centralized administration through Citrix
- authenticated and authorized clients only
- new applications replace internal applications only, nothing externally visible
- client wants developers to focus/specialize on one language

So what did we do?

- application interface uses Mozilla XUL
- JS business objects represent part of the model
- the rest is implemented in Cobol (legacy base of +1M LOC)
- JS framework abstracts everything (DOM manipulation, data entry validation, RPC, dynamic trees, datagrid)
- simple data entry applications even do SQL from the client

Advantages

- time-to-market: the app prototype is the final app
- powerful widgets made usable with less logic
- teams specialize and become more productive
- targets Mozilla, so it is portable across operating systems
- handles local files (e.g. importing Excel spreadsheets)

Note that we have abolished being compatible with other browsers. Our Application Platform is Mozilla.

XUL Resources

Thursday, December 22. 2005

Because XUL apps are usually complex applications, you will need a way to communicate with your application server, handle client-side events, abstract DOM operations away and so on. For that you can either roll a framework for yourself or you can utilize one of the existing base libraries. Note that I only mention OpenSource software (mostly BSD-licensed).

JS libraries:

- TIBET
- Simple Ajax Code Kit (SACK)
- Dojo
- AjaxTK
- Prototype
- Script.aculo.us
- JSLib

Note that these are mostly focused on AJAX and thus DHTML. Nevertheless, borrowing ideas and even code might be possible.

Frameworks with server-side components:

- CPAINT (PHP, VBScript)
- Echo2 (Java)
- Ruby on Rails (Ruby)
- Guava (PHP)
- TurboGears (Python)

Documentation:

- XULPlanet -- all you ever wanted to know about the technical side of XUL

Various toolsets:

- Google's XSL-T/XPATH library
- Client-side drawing (Mozilla 1.8/Firefox 1.5 and others)

Welcome

Thursday, December 22. 2005

This will be a collection of major resources for developing enterprise applications using the Mozilla XUL platform.

The XML User Interface Language (XUL) is a markup language for creating rich dynamic user interfaces. (from XULPlanet)