From DOM to Widgets - An Overview
Filed under: Documentation, GUI, Layout
By Sebastian Werner @ June 9, 2008 12:03 pm
For qooxdoo 0.8 we have introduced a layered architecture from low-level DOM to high-level widget system. For instance, we extracted all lower-level implementation details out of the widget system and moved them into a new layer (that could also be used independently). Interestingly, this was already mentioned about a year ago and I thought it would be a good idea to refresh the information from the last report.
The layers of qooxdoo in 0.8:
- qx.dom contains generic DOM methods. This includes basic stuff like information about the different node types, positioned inserts of nodes, a huge range of traversal functions.
- qx.xml contains specific features to work with XML documents. Features include selectNode, createDocument and string escape routines specific to XML.
- qx.bom contains all stuff which is specific to the so-called "browser object model". Included are features to control specific attributes of HTML elements e.g. utilities to work with styles, class names, etc. It also connects elements to the event system. There are many more things: Computing locations of arbitrary elements in relation to the document, scrolling any visible element into the viewport, inserting Flash movies, working with the browser history and creating pseudo bookmarkable pages, dealing with XMLHttp requests in a unified fashion, detecting the client and a number of the most common plugins, creating enhanced shrinkable labels with ellipsis symbol etc. All these features work in all four supported browsers equally well.
- qx.html is the new high-level DOM manipulation API. It is mainly thought for the managed creation of HTML nodes. It wraps most of the features of qx.bom and offers them in the well-known qooxdoo OO style programming fashion. With this API you work with an instance for every DOM node you like to create. This may seem very expensive at first glance, and in fact it isn't without cost, but in practice it performs quite well. And best of all: it automatically gets a lot of stuff right which otherwise had to be done over and over again in an application or the widget system itself. Yes, the widget system uses this API to work with the DOM. The major feature of this API is the managed creation and insertion of DOM nodes. It works perfectly for multi-pane views (e.g. Tab Views) and makes generation of whole areas as lazy as possible without any additional work required. Compared to qx.bom these features do make most sense when creating a huge chunk of HTML. For simple modification of existing nodes or creation of a handful of nodes qx.bom is the better choice.
- qx.ui contains the GUI toolkit of qooxdoo 0.8. Here you can find all things comparable to other (native) toolkits. This means for instance: real layout managers, improved event and focus handling, decorators for all types of styles, full-blown theming capabilities without the need to use HTML or CSS.
Hope this is a useful overview. Feed free to ask questions, your feedback is appreciated. This blog post will become part of the forthcoming documentation of 0.8.
