On 03/03/2005, at 7:24 PM, Steven Webster wrote:

code - as a pragmatic (slothfull? :-) Flex programmer I am rather fond of using a bit more actionscript in my mxml, but then I understand where Aral is coming from - and in Flash I would never put code in my fla. I would be happy to recommend either framework to a client.

This is the key one; if we have business logic in our MXML, we should be refactoring this into external
AS2.0 classes (and unit-testing it).��� If you have screeds of business logic in a big <mx:Script> block,
then you should be pulling this into external classes - you are beginning to mix your content and
your code.

I call this unhappy situation "View Sag" - for me it's most likely to happen when I haven't spent enough time planning out what my commands, business helpers (filters, validators etc) and view helper are going to do, and it's always a messy re-factoring job.

I'd hate to
cripple the utility of data binding, by taking a purist approach to removing all occurence
of AS2.0 from MXML.� Data binding saves an incredible amount of overall development
time, effort, risk, and leads to an elegance and clarity of code (cheque's in the mail Matt).

Yes, as I said in another post data binding with expressions is the #1 thing I miss going from Flex to Flash. I often use expressions like {vo.middleName == undefined ? "" : vo.middleName} which cut a huge amount of clutter out of the code (and because we consistently use the ternary operator this way it's not too obsfucated for people to pick up).

Cheers,
Robin
http://www.rocketboots.com.au

Reply via email to