Unobtrusive ActionScript (MXML): Separating structure from behaviour
Jul. 12th, 2006 | 07:31 pm
I was intrigued by this comment on TechCrunch (emphasis mine):
The code that you end up with when you use Flex as described in the manual looks like bad HTML, with Actionscript distributed inline throughout the code, and view-level information interspersed with controller code (e.g. width and height attributes on controls, etc...).
In HTML, inline event handlers are considered to be a Bad Thing (TM). To understand why, one needs to think in terms of the typical designer-developer workflow.
There are broadly two roles in the development of a UI: the designer, who does the visual/layout design, and the developer, who codes in the user interaction. The designer may place a button on the screen, while it is the developer who writes the code for performing a specific action (e.g. the submission of a form) on the click of the button. In the ideal world, it's possible for two different individuals performing these roles to collaborate on a UI without stepping on each other's toes. This can be achieved in HTML by maintaining clean separation of markup (structure) from script (behaviour).
( Read more... )