Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One big procedure file vs. hundreds of small UDFs
Message
From
02/02/2002 12:08:43
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00614343
Message ID:
00614405
Views:
23
This message has been marked as the solution to the initial question of the thread.
>Hi everybody,
>
>Yesterday I was totally lost in all different kind of programs, I created or found here and put in our CommonWg\Progs directory. So, I'm thinking, may be it's better to put some of them (which are used most) in our wgUtility.prg
>
>What is better in general: one big procedure or lots of small ones? Which approach do you use? Sorry, if this was asked before (may be even I asked it)...
>
>Thanks in advance.

Divide your UDF by their functionality. Data access functions in data access group, Memo handling functions - in memo handling group, etc.
Make all UDFs from a group as methods of a custom (non-visual) class.
Instantiate this class in the beginning of your app.

Advantages of this approach:
You will have 10 (or more) VCX files each with a given count of methods. You will easily identify the problem area that the methods are. You will possibly eliminate dublicating functionality.

Disadvantages:
Some UDFs can be in more that one group (think about separating the group in two parts) or may be only one UDF in group (you can bind them in one group MISC but it is not recommended)
A little bit memory bloat (you instantiate class in memory - it takes space in it)
other(specified)

Hope this helps
Zlatin Zlatev,
MCSD (VS6)

Make solutions, not programs!

Previous
Reply
Map
View

Click here to load this message in the networking platform