Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Protected property is italics
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00608655
Message ID:
00609815
Vues:
15
The whole reason this comes about is that I use a framework (Mere Mortals) that is based on business objects. The UI references the business objects by dragging them onto a form.

I try to use protected properties whenever possible because I feel that making the visibility as restricted as possible is good OOP design. I haven't used hidden properties in the past.

-Dave


>Dave,
>
>You are right, I just tried this and the instance of the class on the form can't see it's own protected properties. I'm not sure if this is considered a bug or not, I'm sure it's been that way for a long time now.
>
>This goes to show you just how little I actually use protected and hidden PEMs in VFP. I seriously don't find any practical use for them. They make development and debugging an order of magnitude harder. I'm just an open-access kinda guy *s* If I have a PEM that is intended for "internal" use only I put that information in the PEM comment and that has worked well for me so far.
>
>>>When you drop your class on the form you are in effect creating a subclass and you can override PEMs. Any code you add to this instance ...
>>
>>Notice how you used both "subclass" and "instance" to refer to it. It can't be both, but yet it is.
>>
>>> Any code you add to this instance can access the protected property.
>>
>>No it can't! Thats my point. Add code to the click method of the object on the form and you will see that it won't work.
>>
>>Try
>>WAIT WINDOW This.myproperty
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform