Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
protected - question/gripe
Message
From
20/07/1999 00:44:20
 
 
To
19/07/1999 13:54:57
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00243195
Message ID:
00243427
Views:
26
Hi Ken ---

>1) If a property is protected, I STILL think I, as the designer, should be able to set it at the instance level IN THE DESIGN ENVIRONMENT. That is, I want to be able to set the property up to some different default for each instance, but still want it to be 'protected' i.e. other objects can't change it. What am I missing here?

I think you're taking the wrong view of it. Protected means just that: Protected. Only accessable from the class and direct subclasses. A Protected property cannot be changed at the instance level and leaving it exposed in the design environment sets up a possibility of changing it in the instance which is a big no-no at anytime. See?

>2) Again, with protected, I belive that other objects created at the same class level should be able to access protected properties of an object. For example, if I have a form class - and create some protected property on that class, WHY can't buttons, etc. ALSO added to that class access the property? In my mind - buttons, etc added to a form (or other container class) ought to count as part of that container class as far as protected goes.

Your form class with buttons and whatnot put into the class definition is a composite class. Other members of the composite have their own heirarchy and are, therefore, not subclasses of the form where the Protected property is.

If you have these needs, then perhaps you don't really want to use Protected or Hidden properties.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform