Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why classes scare me...
Message
 
To
25/04/2002 11:26:20
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00649170
Message ID:
00649606
Views:
13
Fernando,

I agree with you that there have been answers to questions here that are less than complete. I also agree that when someone wants know HOW to do something suggesting downloading some predefined class is less than useful.

However, as I consider OOP more completely one of the major benefits to OOP is the ability to have black box objects that perform functions and can be used in various places. Now I will be the first to agree that building a black box class is difficult to say the least. It was difficult to build black box functions in structured programming techniques.

In OOP the concept is that in order to use a class one should not need to understand or even know how it works inside. One should only need to know the external interface and the return value. This does not say that one should not be curious or that the user of the class should never look inside. It says that in order for the class definition to have reached its goal it should ot be necessary for the user to know the internals.

Now whe we go to use a class and it fails to work as advertised we have a choice (if we have the source). We can send the class back to the author with a bug report or we can roll up our sleeves and become the class designer and fix it. In order to troubleshoot the funstioning of a class it is necessary to understand the workings inside.

It seems from messages lower in this thread that part of your issue is the use of visual tools. Well that choice is one of preference. A while ago I did most of my development in the visual tools, now most of my work is in PRGs. The only real difference is the interface to teh code. Code is still code.

My preference for the visual tools is that I don;t like seeing code that I don't currently care about while I am worksin. With the visual tools I could have one method open and only see the code in that method. If I needed to see anothr method's code I could open that one too.

My change is due to the fact that most of my work now is with classes that aren't available in the Visual Class designer and I find it easier to work the same way all the time. So when I come across a class that I coudl do in a VCX I don't. I also prefer the single distribution file (PRG) over the file pair that a VCX (VCX.VCT) requires.

But even with a PRG defined class it is my goal to never have to read the code again once I am finished. I want to just use the classes the way they are documented and forget how they work inside.

I have this philosophy that there is only so much room in my head for stuff and I want to dump off any stuff that isn't necessary to functioning to make room for the stuff that is necessary. I am happy to use a class that I don't know or understand, as long as it works. If I need to use an idea from a class then I need to read it's code. But if the class is doing its job well I don't generally bother to dig into its code (until there is a problem or if the documentation is terrible).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform