Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do this in .NET
Message
From
15/04/2005 04:58:11
 
 
To
15/04/2005 03:01:14
Walter Meester
HoogkarspelNetherlands
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01004810
Message ID:
01005024
Views:
31
Hi Walter,

...
>But then I think this might be closest as possible to the VFP code.

I would question being as "closest as possible to the VFP code" to be a worthwhile target ;-)

From a pure OOP point of view I'ld have gone for an interface as the solution for the question of "one method" as well. If you have different "clumps" of functionality to add to different branches of GUI controls, the OOP answer would probably be to create objects implementing the "clumps" of functionality you identified and aggregate these to (or decorate with those) your GUI controls.

When thinking of such an approach in vfp I'ld calculate that some of my convoluted forms for insurances have more than 400 GUI controls and nearly all of them (because of common customer GUI) have more than 100 GUI elements. Now I have to take users into account who start at least 4 of such forms simultaneously, giving me 1000 GUI controls running. Adding even one "custom" control of my own implementing the different functionality wished for to each control doubles that number and is decidedly unfriendly to the resources of vfp and the poor machine running the app. Since I know vfp, I'ld create a way to seamlessly subclass each control and either call common behaviour in a few global behaviour classes by delegation (no code redundancy but slight runtime overhead) or create a builder to keep the work of changing redundant code in common methods across diferent branches to a minimum.

BUT - such a strategy is appropriate for vfp's relativly slow object instantiation and non-linear resource consumption. Calculating the object instantiation in statically typed languages to be between 30 and 50 times faster for small "helper" objects, I get an overhead of the instantiation time of 20 to 30 small vfp classes for adding one helper object to each GUI control for 1000 GUI controls in a statically typed language - And yes, I am NOT talking first time start here for JIT's. So I'ld probably build some kind of GUI-companion object, keeping code redundancy down and somewhat nearer to my first "design reaction".

I'ld go for each languages/platforms strength instead of trying to mirror the approaches - and you are a seasoned enough developer to probably do the same...

my 0.02 EUR

thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform