Have you been reading the articles in the replies? Seriously, they contain
great bits of information that would guide you in the right direction.

Reduce, reuse, and recycle...
http://www.insideria.com/2008/03/flex-performance-memory-manage.html

Array vs. ArrayCollection ­ FIGHT!
http://ectropic.com/wordpress/?p=59

James Ward gets Drunk on ArrayCollections (a.k.a Performance Pitfalls of
Flex¹s ArrayCollection)
http://www.jamesward.com/blog/2008/11/21/drunk-on-software-episode-3-perform
ance-pitfalls-of-flex%E2%80%99s-arraycollection/

Obviously, one of the most difficult aspects of asking a question online is
­ transferring context to the problem. My first reaction to your post is...
Œwhy extend array collection?Œ Is it because you are trying have something
you can swap out (for performance/optimization?) without changing code? Are
you addicted to ŒaddItem¹ - if you are there are probably some good
counseling groups in your area and... doesn¹t the ArrayCollection already
allow one to collect custom objects?

All kidding aside ­ your question about what to do... read the ASDocs on the
Ilist interface and then prepare for the obvious response to your best
practice question: ³Best practices for collections (read: Array,
ArrayCollection, etc) is contextual.² That¹s right! There is no silver
bullet answer ­ best practices for your implementation will reveal itself
after you have properly considered the recordset size, network traffic, db
response times, interface response, encoding/decoding (if you are using
anything like JSON) times, and whatnot. If the Œdata¹ is small then I would
have to say that even asking the question about performance is a waste of
time... If you are talking about Œmegalithic-data¹ I would have to say that
your performance problem isprobably architectural. If your data is somewhere
in the middle ­ these guys have provided clear direction.

Rick Winscot


On 12/12/08 2:14 PM, "burttram" <[email protected]> wrote:

>  
>  
> 
> Is this such a trivial question that people are passing up replying
> in lieu of bringing light to my ignorance, or are there really no best
> practices to speak of here?
> 
> The only way I've found so far to do this is to deprecate the
> overridden method, but even then from time to time we'll get a strange
> error (this doesn't happen all of the time):
> 
> 1021: Duplicate function definition.
> 
> Seems pretty obvious what's causing it, but we have other classes that
> use this same syntax that aren't generating the error...
> 
> Is there any reason we shouldn't do this, or is there another, more
> acceptable way to accomplish what we're trying to do here?
> 
> public class DataTypes extends ArrayCollection
> {
> public function DataTypes(){
> }
> 
> [Deprecated]
> override public function addItem(item:Object):void{
> }
> 
> public function addItem(item:DataType):void{
> super.addItem(item);
> }
> }
> 
>  
>     

Reply via email to