Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I protect my code in the classes so I can give them.
Message
De
12/01/2000 14:51:52
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00316781
Message ID:
00317194
Vues:
14
>>If you really want to do that, keep all your code in a class and subclass it. But whomever you are supposed to be working with won't have access to the methods in your class.
>
>The very problem with classes being not shared or even sharing it as readonly is that not every member of the development team could use it in setting default forms or in mapping fields. That said, it breaks the essence of OOP methodology.
>

Jess, you're incredibly wrong here. The key to sucessful class design is a consistent, well-documented interface. You can put all of a class into a class library and compile it, and make it available as long as the public methods and properties are documented. Inserting a subclass between the closed base class and the instantiation of controls and objects make it possible to enhance or decorate a class whose internal behavior is completely hidden, but whose results are well documented. Proper OOP should permit you to subclass an existing class without needing to know what goes on inside the class itself; if you really do implement OO designs, then you should be able to rip out a class at any ayer, replace it with a clas offering an identical interface, but with possibly radiclly different implementation details and behaviors, and your code should keep right on working.

My objection to hidden code is not that the hidden code is bad, but if you instantiate objects directly from the closed class, you can't make enhancements or decorations to the class without having to hack the instantiation. It's the sme logic behind not working directly from VFP's base classes, but instead, from a subclass of it, so that changes to the base class n be made without altering the rest of your class hierarchy.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform