On 8/1/16, 8:42 PM, "bilbosax" <waspenc...@comcast.net> wrote:

>> Are you using ObjectProxies or a bindable named class?
>
>Yes, I am using ObjectProxies.  I found this little bit of code that
>allowed
>me to convert all of my objects to object proxies so that my itemrenderers
>would see the data as bindable.  I was getting a lot of silent errors, and
>this cleared them up.

Sure, your errors went away, but the cost is performance.  ObjectProxy
removes structure and safety checks which generally help make things
faster and/or more accurate but can take longer to get the code right.

>
>I truly don't know how to make a bindable class of my own.

For some Data class:

public class Customer {
  public var name:String;
  public var address:String;
}

Making it bindable is as simple as adding {Bindable] metadata:

[Bindable]
public class Customer {
  public var name:String;
  public var address:String;
}

If you get errors when using this pattern instead of ObjectProxy, it is
probably because you are accessing properties on the data class that don't
exist on the data class.  IMO, those are worth debugging because the speed
advantage of using data classes instead of ObjectProxy will be significant.


>
>I am in the process of converting my arraycollection to an array and
>seeing
>how that improves my performance.  As Gary posted earlier, do you think it
>would be even better if I transferred the data to Vectors?

As Justin says, no need to convert, the array is already there in the
source property, or if you have filter and sorting on, you can call
toArray().  Then process the Array outside of the AC and replace the
source on the ArrayCollection.  If you want to use Vector it should be a
bit faster, but it may not be a huge factor, and the cost of transferring
to/from Vector could outweigh the gains.

HTH,
-Alex

Reply via email to