Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper technique for Functions/Procedures
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00095133
Message ID:
00095267
Views:
20
>I used to define functions and procedures in my SCAFFOLD.PRG in the pre-VFP5 days. If I were to take oo programming seriously, what would be the proper way to deal with such things nowadays? What are the advantages and pitfalls?

--------- reply --------
Michael:

One of the nice things about moving to oop in foxpro is that you can keep all of your old procedure files so lovingly refined over many years. In other oop languages, procedures are outlawed i.e. CA's Visual Objects, for example. A Clipper programmer switching to VO is basically starting over -- virtually none of the old pre-oop functions or procedures carry over to Visual Objects.

When I started with VFP3, I started developing a universal application object that I could use as the basis for any application, and slowly moved my basic procedures and functions to oApp as methods.

At this moment, I cannot honestly say there was any particular advantage to doing so -- except you feel more like an oop programmer. There is no evident advantage in speed or functionality to moving all your basic procedures to an application object -- at least none that I have seen.

There is a definite speed advantage to calling an object method from within the object -- since the object is already loaded. If you access a method from outside the object, the object first has to be loaded, then the method found and executed. This takes an imperceptible amount of time -- unless you are doing it a couple hundred times -- then you will see the difference.

I prefer to have one general method or procedure located centrally that all objects use, unless I have to access it frequently from a particular object, then I copy it to the object as a user defined method. This is an instance of the great flexibility of VFP -- you can do that readily.

There it is, the sum of five years experience at playing around with this stuff. Not much, is it?

Regards,

JME
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Previous
Reply
Map
View

Click here to load this message in the networking platform