Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Network:
Windows 2008 Server
>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement