Hi Gene,

Am 13.06.2009 um 18:37 schrieb Gene Amtower:

> I appreciate your input.  I see how that would be simple, but I was  
> looking to avoid redundant variables for objects that can be  
> referenced programmatically.  Maybe there's no penalty for creating  
> a variable to reference each object in the window, so I can see how  
> this would ease my development effort.

I don't think there's any penalty. An additional member variable just  
means one more reference per widget. Giving each widget an ID is  
actually worse since you need a string (the ID) in addition to a  
reference (pointing to the ID).

I might be wrong (depending on the actual implementation of the child  
control handling, which I haven't looked at), but we're not talking  
about a relevant amount of memory anyway here. An additional reference  
for a widget is completely dwarfed by the resources occupied by the  
widget itself. I'd say don't fall into the "premature optimization"  
trap :-)  Plus the implementation gets a lot easier by using instance  
variables.

> Now that you've suggested it, it seems so obvious to me.  (Thank  
> you, Mr. Obvious!)  I have to wonder why the documentation doesn't  
> offer it as an alternative to the child management approach in the  
> Custom Widget chapter.
>
> I guess there must be appropriate scenarios for both ways of dealing  
> with child controls, but I think I'll give the "member" approach a  
> try unless someone raises a serious concern about large numbers of  
> member variables within a class file.

See above. It's lots of members in a single instance vs. one  
additional member for each widget (the ID), but you end up with the  
same number in both cases.

Regards,

   Andreas J.


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to