Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Superclass vs. Subclass structures
Message
From
29/10/1998 07:51:09
 
 
To
28/10/1998 22:20:59
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00151975
Message ID:
00152201
Views:
21
Hi Mark ----

There is certainly nothing wrong with 4 and I'd venture to say that an awful lot of coding is being done without abstract superclasses.

But think of it from the standpoint of messaging and implementation vs. interface. In a situation where an object has to blindly call a "vehicle", shouldn't it expect the same properties, events, and methods...that way the object need not know the type of vehicle?


> I would choose 4. The vehicle class is way too generic for the three subclasses. And if you further subclass the airplane,rowboat, and car classes those classes will have very little use for the vehicle superclass. So the Vehicle Superclass becomes nothing more than wasted resources. You end up with an object that's taking up more resources than it needs. On the other hand if you had the Vehicle Superclass you could overload the + operator and then
>airplane + rowboat = airboat. What do you think?
>
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform