Store Code in Object or Module?

Kevin_S

Registered User.
Local time
Yesterday, 20:46
Joined
Apr 3, 2002
Messages
635
Hi Everyone -

I wanted to get some of the experts on this forums opinion on what is the best way to code. Is it better to store code in the object module or is it better/ more effecient to store the code in a common module and call the code to the object as needed?

I have heard differing opinions on this and also picked up some knowledge on this (such as calling code when needed instead of imbedding it in the forms will speed up form load/refresh times) so I thought I would post the topic hear and see what others have to say.

As for myself, I commonly put code that is object specific in the object's module and other code that I use for multiple objects I place in module call '(TYPE_OF_OBJECT)Operations' and call it when needed... (i.e. if its form code its stored in a module called 'FormOperations')

How bout you?

Thanks,
Kev
 
Kevin,

There is no right answer to this because it all depends.
Some code you want centralized, others you dont!
Just like humans...we wear clothes to cover our privates :-).
We dont want people to laugh now do we!
Sometimes code needs to be public / private / form level / module level. If you happen to see yourself doing the same thing over and over than you create a module and call that function. If its something you only need on a specific form like a find feature you do it at the form level and privatize it. Or keep it public so other open forms may call on it as well.

So the answer really is, it depends.

Jon
 

Users who are viewing this thread

Back
Top Bottom