onsdag 8 september 2004

Layout Hurdles

I first read about MyXaml months ago on OSNews (the successor to the great BeOS related news site). It’s an open source effort to provide an XML based object instantiator similar to Microsoft’s upcoming XAML (to deput in the next Windows release Longhorn). Although MyXaml is not tailored to work with any particular types of objects (as long as they follow some rules), it was primarily devised — as was its inspiration XAML — for use with user interface specifications.

I have not yet played with MyXaml but I am delighted that we do not have to wait for Longhorn to use XML in .NET applications. However, it’s quite tedious to have to keep track of the absolute position and size of controls. Something that really stunned me was the fact that Microsoft chose not to include tools for dynamic layout management, similar to those provided by countless frameworks before such as AWT/Swing in Java, MUI and BGUI in AmigaOS and XUL in Mozilla. Those frameworks allow developers to specify the relative position and size of controls in a cunning way — by grouping controls into nested hierarchies where special layout managers manage child controls. Java’s BorderLayout is a particularly powerful example — by nesting objects managed by this layout manager, it is possible to specify a user interface of almost any complexity.

In early 2001, as part of an engineering thesis, I set out together with a friend to create the under-pinnings of a simple platform-independant widget library with dynamic layout facilities (with proof-of-concept implementations provided for Windows and MacOS). We decided at the time to call the library BORG, for Basic Object-oriented Responsive Graphics (the name was not at all inspired by Star Trek, we promise!).

I feel tempted to dig up the old source code and provide similar layout managers for .NET. I have a feeling that something like that, together with MyXaml, could be a killer combination. Thankfully Microsoft has had the foresight to provide hooks for layout management in the .NET framework.

Inga kommentarer:

Skicka en kommentar