Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extending base control functionality
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00636085
Message ID:
00637592
Vues:
15
>
>What do you think about performance? Do you think that checking, if there is a hook object and if yes, passing the event along sevaral objects might affect performance more than having the code in subclasses? IMO this shouldn't have a lot of effect.
>

I did some playing around with this a while back. I've got a "resizer" class that I've been working with on and off for a while. Instead of the common Observer-type pattern that is commonly used, I decided to add a resize object to each control as it instanciated (so I could swap in alternate versions for things like grids). The form objects Resize() event would call this object, which then takes care of positioning and sizing the control. I was initially worried that instanciated all of these objects at runtime might really slow things down, so I ran some tests to determine the cost of this, and of passing the event down to my resize object instead of coding directly in the Resize() method. I don't have the specific numbers handy, but the hit was very minimal. As in, less than 1% over a huge number (10000+) of instanciations and calls.

So, I wouldn't worry about the performance hit unless you've got a huge amount of code firing for every event.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform