Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Encapsulation problems
Message
From
03/06/1998 11:34:26
 
 
To
03/06/1998 01:18:40
David Moreau
Iglesia Ni Cristo - Dnm
Quezon, Philippines
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00104274
Message ID:
00104395
Views:
29
David,

If you are coming to VFP from another OOP language, its conventions will probably drive you nuts until you get used to them. The fact is that in VFP protected properties and methods are scoped solely to the class -- and cannot be accessed even by subclasses. Makes one wonder why M$ bothered to provide protected PEMs with protection so restrictive as to be virtually useless. The adequate solution in most cases is to leave them public -- VFP does not even try to enforce encapsulation. If you protect a property, the you should provide a public method to extract the property's value if you are likely to need to extract it from outside the class.

I presume you are using your array as a rowsource for a combobox. In your abstract combobox class, add an array property. I use aRowSource[1]. There are a number of ways to fill aRowSource[], the best imho is to use VFP's powerful select-sql command to extract the necessary data from a table. For this purpose I use an UpdateRowSource() method which is empty in the abstract class and is customized to the needs of each subclassed combobox object. Both the array property and UpdareRowSource() method should be public in scope.

To use the array as the rowsource, simply set .rowsource = "this.aRowSource" and .rowsourcetype = 5.

regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Previous
Reply
Map
View

Click here to load this message in the networking platform