Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Superclass vs. Subclass structures
Message
De
29/10/1998 07:51:09
 
 
À
28/10/1998 22:20:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00151975
Message ID:
00152201
Vues:
22
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform