Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which is the right place for the code?
Message
 
 
À
17/11/2003 17:04:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00850779
Message ID:
00850800
Vues:
19
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform