Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there any way around this issue?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00793727
Message ID:
00794812
Vues:
20
>>Hi Steve,
>>Now we mey be getting somewhere.
>>I get your vehicle class, but it would still have a BaseClass (probably Custom). What I seem to be getting from the others is that the vehicle class should be based on a "concrete" class mySubCustom that's based on an "abstract" class myCustom that's based on Custom. I should not base vehicle on MyCustom (because it's abstract) but instead base it on mySubCustom. WHY?
>
>PMFJI - normally you don't directly inherit from an abstract class because the abstract class doesn't include all of the code necessary to produce a fully functioning class. It's a design choice. The idea is that it includes all the stuff common to most subclasses you will create (or, in a lot of cases, contain no code at all - they just define the interface via properties, methods and events), but that those subclasses will contain more implementation code to do the real work. While it's also possible to just use this subclass directly, the basic design idea is that you probably will need to customize this class even more for a specific case/form/etc. (eg. set some properties to define behavior, appearance, etc.). In order to maximize reuse, you inherit from the "mySubCustom".
>
>Here's what the hierarchy ends up looking like:
>
>abstract vehicle
>^--SpecificVehicle
> ^--InstanceVehicle
>
>Hope that helped and didn't muddy the waters even more.

Hi Paul,
Maybe it's finally getting through. I get the feeling everyone is talking in a language that I don't know and I'm trying to put it in VFP language.

What I get from you is that the "abstract" class has minimum functionality by design, possibly not even enough functionality to create a usable object. That you are "deciding" not to create objects with it and even the least functional object would be created from a subclass of the "abstract" class.
My thinking is that the class closest to the BaseClass should be the least functional class capable of creating a usable object and those classes that want more functionality would be sub-classes of that.

If that is not an acurate description of what I'm missing, then I guess I'll just have to accept the idea that it's over my head.
Bill Morris
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform