Wednesday, February 21, 2007

F3: Swing DSL, not Declarative Layout

I had looked at F3 a few times blog entries a few times, and come away with the impression that this was basically a configuration language for declarative layout. It isn't.

Looking at this entry, and the attached code, it's pretty clear that F3 goes way, way beyond layout, into behavior. This makes it more of a Domain-Specific Language for the user interface layer of Swing applications than a declarative layout configuration.

It's interesting that it does that, but it raises more questions than it answers, to me. What appeals to me about declarative layout configurations is two-fold:

  • Java code is a pretty verbose way to layout a UI. A declarative syntax can be brief, because it's purpose-designed. F3 seems to have this capability.
  • Java code is somewhat painful to forward and reverse-engineer, tending to result in layout code you don't really want to maintain, or that changes in ways you hadn't intended. My concern with F3 is that by going into behavior and taking on additional syntax, you run the risk of creating a DSL that doesn't match well with visual layout tools, and has the same concerns with forward- and reverse-engineering.
Of course, since F3 isn't really paired with a UI builder at this point, the second bullet may be moot.

No comments: