Download qxoo now!

The last couple of days we had some time to use our new qxoo package, which you might already have read about,  and did some experiments with it. All of us here in the core team like it so much we thought we had to write another blog post to show some details on how to use it on the server side.


So here we go! As a first example I want to show you how to use it on node.js. We are using classes, inheritance, properties, the event system and even single value binding in this example.

var sys = require('sys');
var qx = require('./qx-oo.js');
qx.Class.define("Fish", {
  extend : qx.core.Object,
  properties : {
    age: {
      event : "changeAge",
      init : 3
qx.Class.define("Shark", {
  extend : Fish
var fish = new Fish();
sys.print("The fish is " + fish.getAge() + " years old\n");
var shark = new Shark();
shark.addListener("changeAge", function(e) {
  sys.print("The shark changed its age to " + e.getData() + "\n");
sys.print("The shark is " + shark.getAge() + " years old\n");
fish.bind("age", shark, "age");
sys.print("The fish is " + fish.getAge() + " years old\n");

The output looks something like this.

The fish is 3 years old          // 1
The shark changed its age to 5   // 2
The shark is 5 years old         // 3
The shark changed its age to 3   // 4
The shark changed its age to 7   // 5
The fish is 7 years old          // 6

Surely you’ve seen that we are creating two classes, a fish and a shark which is a fish of course. Our fishes have one property named age. Properties, in short, are data stores with automatic generated accessors and other goodies like in this example, a change event. We create an instance of each class and play around with the generated setter, getter and events. The second to last line shows the single value binding which synchronizes the two age properties.
This should look familiar to anyone using qooxdoo, the only difference is that its running on node.js and not in the browser (This is the corresponding “browser version”, just make sure you check the Log pane to see the same messages).


Next up, let’s write a script to run in Mozilla’s Rhino that demonstrates the use of Mixins:

qx.Mixin.define("MBar", {
  members :
    bar : function()
      return "bar!";
qx.Class.define("Foo", {
  extend : qx.core.Object,
  members :
    foo : function() {
      return "foo!";
qx.Class.include(Foo, MBar);
var foo = new Foo();
print(; // "foo!"
print(; // "bar!"

Again, with the exception of the Rhino-specific load and print statements, this is plain qooxdoo. Assuming that js.jar (the Rhino Java archive), qx-oo.js and a file containing the code listed above, named e.g. test.js, are all located in the same directory, this is the shell command that will run the script in Rhino:

java -cp js.jar test.js

If you want to give it a try you don’t have to download the SDK and build it yourself. Just go to our devel applications page and download the precompiled script in either an optimized or unoptimized version. This will be updated usually once a week on Friday, like all other qooxdoo online apps.  While this qxoo package is still in experimental state, the code it contains is rock solid, having been used for a couple of years in the browser. Give it a try and send us your feedback!

2 thoughts on “Download qxoo now!

  1. Looks very nice. Even better would it be with the new property system as two of the main features impacting the it’s weight are basically not that useful in server side environments: inheritance and theming.

  2. Pingback: qooxdoo » News » qooxdoo 1.4 and 1.3.1 released

Comments are closed.