Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where goes the code
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00225781
Message ID:
00225802
Views:
16
The code goes where all the code finally goes: into the CPU! :)

In cases like this, uses common sense. Ie put the code where it belongs. If the message is related mainly to the action in the form's method, put it in the form's method (I usually think like this: will this method posssibly be called from other places than that button? If yes and if I want to have the same message from everywhere, its place is in the form's code). If it's mainly related to the action of "pressing" that button, put it in the button's code.

Simplifying a lot, OOP is about only one thing: to make our work easier. So, use your common sense for almost anything in OOP, just to make your work easier. Only one comment about this: don't make it easier only for you and only for today. Make it easier for those coming after you (or you coming after you:)) and make it easier with the future (of the code) in mind. Besides that, all rules are made to be broken! :))

Vlad

>If the job of a command button is to initiate code that goes in a custom method of the form or in a method of a separate object, where is the best place to put the conclusion of a process: the message that goes in the status bar indicating completion of the process or error in the process or whatever?
>
>Is it in the command button? In the method code? In its own message object?
Previous
Reply
Map
View

Click here to load this message in the networking platform