Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control Object vs. Container Object
Message
From
20/04/2018 08:31:21
 
 
To
19/04/2018 14:02:54
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01659539
Message ID:
01659557
Views:
69
>With a control it properly hides the timer and you need to create a method on the control:
>
>
>loControlObject = Newobject("MyControl","Classlib.vcx")
>loControlObject.Start()
>
>
>Latter is the better solution, because the calling object should not need to understand the inner plumbing of the object's logic. This is the same logic in C# for instance, so other developers might be more familiar with it.

"Better" IMHO is to harsh/judgemental. If you view every programming language from the mindset of a Java/C# "fanboy" such a statement might be true, but to me every language has a "sweet spot" which defines the way to code in ***that*** language, and while the characteristics of the traits/dimensions "available" in each sweet spot are comparable, the sweet spots tend to fall in similar areas for similar languages.

In "scripting languages" (dynamically/duck/loosely typed, at least partly interpreted runtime/VM, EVAL()-ability in basic language construtcs) the visibility of inner plumbing often is not hindered, only goverened by convention (prefix with "_" or "__" in Python for example).

So Control follows the prevalent coding pattern found in Java/C#, while the vfp language has more traits common with Javascript, Python and so on. As long as you follow some other mostly nice rules, like "chunky, not chatty" object "interfaces" (more speaking in an API sense vs. Interface as language detail used in object creation...) modern machines are fast enough to protect you from slower function/method calling speeds found in scripting languages, so you can follow the Java/C# prevalent coding pattern in this aspect with no large detriments and reap the benefits you are angling for ;-))

my 0.02€

thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform