Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sub-classing
Message
From
27/03/1997 19:51:39
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00025781
Message ID:
00025975
Views:
36
>>Actually vcx's are class libararies that store classes. And classes are a must if you do OOP. In VFP you should subclass the base classes of everything and then subclass those for each application for a start. Read Arnon's article on OOP in the VFUG newsletter section.
>
>SO OOP is like clicking on a gif in netscape that points to
>something further? Is that what it can be compared to?
Let me give it a shot...
OOP is like a building a machine (car for example)

Each final OOP program is like a particular type of car that rolls of the assembly line.
When a car it built, they dont make all 100000 odd parts and put them all together one-by-one (sequential programming). They install different pre-built assemblies. Any given assembly will be made of individual parts, or other sub-assemblies. The indiviual parts correspond to OOP objects and the assemblies correspond to classes

Each part has it's properties height, weight, color, etc. An object has properties too...font, bold,etc..

One of the greatest strengths of OOP is that you can re-use classes throughout your application and other programs. For example, a Mustang brake assembly might be used an an Escort. You define the properties of a class one time and if you want to change a property (say screen color) you change it once in your class definition. Every place that you used that class in your program (called an instance) the color will change (inheritance). If you do not want every screen's color to change, you can go to the instance and override the inherited screen color with whatever you want..

Another big difference is that OOP is event based. This means that your program performs actions as each object is "clicked" on. This is done through the use of the objects methods. You have methods available for example when object gets attention (by tabbing or clicking on it), you might want to show it bold and hide some other object. You would do this by setting the appropriate properties in the "GotFocus" method. Perhaps

this.bold=.t.
thisform.otherobject.hide

When you click on it again you might want it to go to turn off the bold and go to another control button. In the "Click" method you would add somthing like..

this.bold=.f.
thisform.othercontrol.setfocus

There is a ton of stuff that you have to figure out, heaven knows I'm just starting myself. But I think that you will agree that it is a leap forward and one that can be easily transferred to any visual language.

I am fairly new to OOP so please take what I said with a grain of salt. If anyone see's anything wrong with what I said, I would appreciate your comments.

Welcome to the world of OOP!
Larry
L.A.Long
ProgRes
lalong1@charter.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform