Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper Encapsulation Techniques?
Message
 
To
31/08/1998 14:47:45
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00131613
Message ID:
00136675
Views:
34
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform