Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-219

Access-controlled MXML Properties

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Later
    • Adobe Flex SDK 4.0 (Release)
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      By default properties in an MXML file identified via their id property seem to compile to public properties of the resulting ActionScript class. However from an OOP perspective this doesn't seem optimal.

      On various Consulting projects we've agreed to restrictions on how to treat views (including MXML). The quintessence was to extract the complete state and behaviour into ActionScript classes that are easily unit testable i.e. (aka Martin Fowler's Presentation Model Architecture) One of the agreements made were to never allow MXML components to access properties of other MXML components. I've often seen this being done by customers and often this turned out to be very difficult to manage in any non trivial application.

      Following this agreement it means that MXML files are not exposed by default. The developer can expose properties via the mx:Script tag and use data binding to let MXML components connect. This adds quite a bit of security to a large application of what potentially can happen.

      Now, the rules were non technical, only by agreement.

      If there would i.e. be an optional compiler flag that marks every MXML property to private by default, it would enforce more saftey towards this.

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: