On Fri, 16 Jul 2010, Greg Brown wrote:
Well, personally I'm not too happy with the direction BXMLSerializer is
taking things... from UI-centric to UI-agnostic.
I think you may have missed the point. WTKX was never UI-centric, except
in name. There was nothing specific to the org.apache.pivot.wtk package
in there. Moving it to org.apache.pivot.beans required no refactoring
other than changing the name.
I don't think I expressed myself well. WTKX was never UI-centric, but it
looked like it, and being a "subproject" of WTK it had the whiff of
UI-ness to it. :)
If it isn't UI-centric, I consider that an opportunity for growth. If
Pivot has a markup language for making UI-building easier, it should make
some assumptions about its problem domain to simplify that task.
I think one way to approach this goal is to consider BXML as a sort of
intermediate language---an input to a serializer that builds a component
hierarchy. You could keep that completely clean as a sort of souped-up
javabean serialization format, hell, even cleaner than it is now.
On top of BXML would be a DSL that makes some UI-centered assumptions.
It might make some assumptions about the use of some style language, like
CSS, to make it easier to work with. It might use CSS inheritence and
cascading. It might allow closer integration with scripting (*cough
PIVOT-573 ahem*) and richer event-driven binding support.
XAML works the same way - it isn't tied to WPF. On the other hand, MXML
is tied to the mx namespace, which I think is a limitation. It makes the
markup language more complex and more difficult to maintain, because it
allows for "special cases". We try to stay away from special-case code
in Pivot.
There is a lot of crap in MXML. I'm not holding it up as an example of
greatness, but at the same time it does have some very useful, time-saving
features, some of which I noted above.
Cheers,
Michael