Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Superclass vs. Subclass structures
Message
De
29/10/1998 09:27:09
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00151975
Message ID:
00152264
Vues:
24
Hiya Marty ----

>
>Help me out. What do you mean, intrinsic to the object? Do you mean, you wouldn't choose to instatiate the "mover" object, and instead keep those "mover" methods somewhere within the super/sub class?
>

I would have a Move method at the superclass level, that way all calls to "vehicle" subclasses would message the same way. The actual functionality (code) of the Move specific to each vehicle subclass would be at the subclass level (car, airplace, rowboat)

oChevy=CREATEOBJECT("Car")
oChevy.Move()

>If so, I agree with you that this is a much simpler/more direct approach. Especially if there is NO chance of there being more vehicle types added in the future. The biggest risk there is Class Library bloat.
>

Why is there bloat? The functionality is at the subclass. The subclass is object specific. If the code was in the superclass, I would agree.

>I've been working alot with the design patterns lately, and well, you know, I've got a brand new hammer, now everything looks like a nail. <s>

ROFL....I hear that.
------------------------------------------------
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