Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which is the right place for the code?
Message
 
 
To
17/11/2003 17:04:58
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00850779
Message ID:
00850800
Views:
18
This message has been marked as the solution to the initial question of the thread.
Ricardo,

To add to Alex's reply

> and a client who wants to use the services of this class, must call oRefToMyform.btnDo.Click().

This sort of code is bad OOP. The outside world should not be calling into a method of a contained object of the form, because it breaks the encapsulation of the form.

Technically your form is the UI layer too. If your form class has an Accept() method, then the button on the form, and the toolbar can both make calls to the method. Your actual implementation of the Accept method might be something like:
thisform.oBusinessRules.Accept(...)
which actually delegates this off to be handled by a true BR layer. But the form button and the toolbar won't know what is really doing the work they want done.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform