// you’re reading...

XAML, ONML, etc.

XAML

XAML looks like a well thought out (for the most part) large step forward for MSFT Windows. So, large, in fact, that despite their being so far behind, they have leapfrogged the Java GUI platform and, from what I know of it, the Apple as well. How this positions MSFT within the industry vis-a-vis GUIs and how the industry is, and should, respond is a juicy subject for discussion, albeit somewhat depressing for those who scorn MSFT.

XAML has a number of apparent quirks - though maybe these can be explained away by someone who is in the trenches. The major ‘quirk’, as I see it, is:

Code Behind’ing.

This is the mixing of XAML and code in a single class. This entails the mixing of knowledge of code into the XAML and, implicitely, XAML in the code. Why does this remind me of bad C++ and in general not knowing just what the hell the code you are looking at is going to do, the breaking of encapsulation of knowledge (pollution of the knowledge space), and a general level of confusion about what goes/went where.

Yes, I understand that most of this stuff is going to be tool-generated and users are just going to type code, when prompted, into a little window, in this kind of constrained, code-by-number paradigm so popular on that platform these days. But then the point of making XAML more readable than, say, Flash, is kind of lost on me. It might as well be binary, aka bytecode. And although a lot of the impact of XAML will come from just this analogy - I can’t help but think that there is a advantage to having an XAML-laced application be at least as readable as JSP/ASP HTML (which are analogous to the approach that the Obsidian Framework’s ONML takes to deal with the same issue of supporting markup with code written in a real programming language).

Binding…What you are actually binding TO, using XAML, when it is not a resource (interesting that the whole concept of ’staticresource binding - i.e. using the ‘binding’ to copy the valuer from the resource exactly once - presumes that an application will be terminated and then restarted periodically) defaults to binding to the data referenced by ‘datacontext’, which itself is specified in the ‘code behind’. Ugh.

Otherwise, what looks cool is:

1. Binding implementation.

It looks nice and clean the way the code behind classes are defined to allow them to be bound to. A little laborious, coding wise, but the IDEs do most of the coding on that platform anyway.

2. Attached Property Syntax

Not sure how great a name that is, but, after I thought it through for awhile, the idea seems great. Maybe this is used in a lot of other frameworks, but it seems to solve a problem that I have looked at for a long time. The problem is:

How to specify properties on a part that is only relevant to the container (usually a layout) of that part. I.E., how to tell the container that part #3 is to be placed at the left of the container’s bounds?

I know of two (well, three) ways to do it:

1. A property on the container (i.e. part#3.position=left)
2. By implicit configuration of the container (i.e. left-justified) and making part#3 the first part
3. A property on the part (i.e. position=left)

The cool thing about Attached Property syntax is that it uses approach 3) but adds a scoping factor: (i.e. container.posiiton=left). This helps keep things sane when the part is deleted or moved to another container. It fails for copying, however, as then one would have two parts that have ‘container.position=left’ properties (unless the implementation of ‘copy’ knew to remove all Attached Property syntax attributes during the copy operation (and the fallout from that little quirk I have not thought through).

In conclusion, XAML is the first real attempt of a real company to popularize a real graphics user interface markup language. Awesome!

Hopefully this will pave the way and legitimize some of the rest of us who have a slightly different approach UI markup, and more specifically to the user, than the Model A, one UI fits all approach taken by the current Software Superpowers.

Discussion

No comments for “XAML”

Post a comment

You must be logged in to post a comment.

Categories