Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access and Assign vs. OOSE
Message
 
 
To
26/10/1998 14:05:11
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00149911
Message ID:
00150677
Views:
42
Erik,

This would be a good way of hiding changes to the underlying tables/fields. It still is a public interface though. It's a potentially much more stable interface though if you dissociate from actual table/field names. Although you can wind up with a rats nest of several names for each thing in the system which becomes a nightmare to maintain. Like LastName is the property cNameLast is the field name. This could be a plus though if you are trying to interface to several backend systems with different names and want to use obiz to separate it's clients from those names. There's definately two sides to this coin.

Once you've "published" the interface item named FullName you have to keep it in place. It does raise the issue of is that a writeable item? It probably shouldn't be, since most people would know it was an entity built from other entities. If you had a GetFullName() method without a SetFullName() method the public namespace would maybe be a little clearer that it was not writeable. The interface documentation can pretty easily detail the read/write status of each property though.

I still like direct property access though because the public namespace is 1/2 the size. For example, LastName vs GetLastName() and SetLastName(). Half the size also indirectly implies half the complexity.

>I agree. This point seems moot. If you argue that Get/Set are advantageous because you don't have to modify the middle tier to add a field, but you _do_ have to modifiy the field to practically use the get/Set methods (to add logic), this point defeats itself. IMHO Access/Assign is just as clean as Get/Set.
>
>The property 'accessed' using access/assign doesn't even have to be the property that actually stores the value! I could add a property and corresponding a/a methods called obiz.fullname that returns obiz.fname + " " + obiz.lname. In this case, the real properties aren't exposed at all. Doesn't this conform to the assertion that object should hide properties? If you agree with this then the a/a propertyhaving a different name from the actual property becomes a triviality. I could change the name of the property without changing the public interface at all. Just like get/set.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform