Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
News from VB7. I'm in shock.
Message
De
17/02/2000 16:12:50
 
 
À
17/02/2000 14:06:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00332397
Message ID:
00333718
Vues:
17
Hi David,

English being the precise language that it is, I guess I misunderstood the word "context".

I'm not chasing a rabbit here, I'm (was, until "data" was clarified for me) curious as to the apparent (in my eyes) difference from VFP as regards OOP. It still sounds different to me in the overall, but clearly I'm in the minority here and defer to the vast majority who sense otherwise.

Cheers,

Jim N

>Jim,
>
>>You are focussed on the "can be hidden...". I read "It packages data, and the methods that act on that data..." and I see that as very different (potentially) than VFP.
>
>The next sentence is:
>
>An object's data can be hidden to prevent unauthorized modification. The object surfaces a set of public methods to operate on this data. This concept is called encapsulation.
>
>A few paragraphs later in the section on Encapsulation:
>
>Encapsulation
>Encapsulation means that developers can contain and hide information about an object, such as internal data structures and code. It isolates the internal complexity of an object's operation from the rest of the application.
>
>For example, when you set the Caption property on a command button, you don't need to know how the string is stored. Visual Basic will help you do this by letting you declare properties and methods as private protected or public.
>
>Why would you want to protect class members? Let's assume that certain properties of a class represented an object's state. If you couldn't prevent those properties from being accessed directly from outside the class, how could you ever guarantee the state of that object? If you protect the property, you could then create a custom method that would be used to assign values to that property. The method could contain validation code to ensure that the value is set properly. Since the property value is assigned in just one place, the code becomes much easier to debug and maintain. In the example below, "me" refers to a specific instance of a class.

>
>The major difference I see from VFP is "me" instead of "this". I think you're chasing the wrong rabbit here.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform