Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper Encapsulation Techniques?
Message
 
À
31/08/1998 14:47:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00131613
Message ID:
00136675
Vues:
33
SCATTERING a row to an object works great if you only need to pass a single row, but what if you need to pass multiple rows at a time? Would the best way be to scan through the data, scatter to an object, call the update method and then move to the next row and repete the process?

>I think the premise, that "modifying a bizobjs data from outside the bizobj is bad behavior for a properly encapsulated class", is questionable.
>
>The real question is why does the client need access to the particular data, and shouldn't the class be providing this service.
>
>Anyway, in the two scenarios described below, Example two is not recommendable because of the rather shitty interface. As for example 1, and _Access or _Assign method, if you are using VFP6, is probably better.
>
>But the best way to go may be something like
>
>  SELECT Customer
>  SCATTER NAME oCustomer
>  ...
>  loCustomer.Update( oCustomer)
>*---------------------------------------
>
>

Michael G. Emmons
memmons@nc.rr.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform