Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ideas for passing records back to calling form
Message
De
22/09/2015 16:05:04
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
22/09/2015 09:32:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01624724
Message ID:
01624942
Vues:
83
>>Wow. How about doing nothing and getting the best speed? Have the called form adopt the data session of the calling form. 3 lines of code. Talk about overkill and waste.
>>
>
>Hi Mike:
>
>He can do that, obviously, but I prefer to suggest in the line of encapsulation and separation of concerns, because having a private datasession for later changing datasessions for me is like having local variables but having a special method to read them from outer modules, this breaks the encapsulation.
>
>But this is my personal point of view, and every developer can use what think it's better for him/her.

A cursor exists in one data session. It is encapsulated. The form has a private data session. That makes it encapsulated. The child form may drop the veil between itself and the calling form. The cursor remains encapsulated. The two forms are now encapsulated in one data session. They are encapsulated against interference from other parts of the system. That is the only important thing.

The term encapsulation refers to an OOP object not exposing its properties and methods to other objects at inopportune times. If an object is instantiated within/by another object, it may certainly access the properties of the containing object. Dropping the veil in this case is no different.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform