0 Replies Latest reply on Oct 8, 2009 8:55 AM by smirnoff81

    Clarification for "TooLongBindingExpression" needed

    smirnoff81

      Hello,

       

      I have a couple of "TooLongBindingExpression" violations.

      The code in question looks like:

       

      <mx:Label x="{component1.x + component1width - Class1.CONSTANT1 - Class1.CONSTANT2}"

       

      The description of the violation says:

      "This binding expression is too long (3 dots maximum, but 4 actually). A Binding expression is executed as soon as one of the bindable attributes changed. If a binding expression contains too many expression, there could be some performance issue".

       

      What does "3 dots maximum" mean?

       

      Does it mean you should not have more than three nested levels i.e. var.attr1.attr2.attr3.attr4 will raise a violation?

       

      or

       

      Does it mean you should not have literally more than 3 dots i.e. any mixture of nested levels for example like the code above?

       

      My questions is not only about the current implementation but also what exactly the rule aims to prevent. I have different than AS background so my expectations might not be very accurate.

       

      The example I gave in the beginning has two constants and I guess constants should not be included in the "dots" calculation (or whatever threshold) since they simply cannot change.

       

      Another question though ... is the rule supposed to catch code where there are too many bindable variables but not too many dots like for example
      {var1 + var2 + ... + var10} ? We do not have any dots here but we have 10 variables we listen to for changes.

       

      I might need to create a ticket for the current implementation but before doing it I need this clarification.

       

      Thanks,

      Smirnoff