Why in Flex does the code behind the template use the ActionScript class as the base class instead of using the MXML component for this?
I mean, instead of extending our AS3 code one by one, why aren't we extending our MXML in the new AS3 class?
Using this approach seems more natural, since it is a real extension, we add code and functionality to our MXML database.
Using the code behind the template is a hack for OOP, every time we add a component to our MXML, we need to change our AS3 class, that is, if we modify a child element (MXML), we also need to change the parent element (AS3).
What is wrong with the opposite code ("code ahead"?)?
source
share