Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does vfp support polymorphism?
Message
De
20/06/2003 17:39:16
 
 
À
20/06/2003 16:55:13
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00802118
Message ID:
00802469
Vues:
42
Love the example!

So polymorphism is basically totally programmer dependent. There seems to be nothing "in" the language designed to specifically make polymorphism possible (or not).

It looks like I could say that "polymorphism" in OOP is the considered and judicious use of inheritance to permit same-named methods to respond as appropriate for its context. (or something close to that)

thanks

>Polymorphism:
>
>"Generally, the ability to appear in many forms. In object-oriented programming, polymorphism refers to a programming language's ability to process objects differently depending on their data type or class. More specifically, it is the ability to redefine methods for derived classes."
>
>
>   o1 = CREATEOBJECT( "Duck" )
>   o2 = CREATEOBJECT( "Pig" )
>
>   o1.Speak()
>   o2.Speak()
>
>DEFINE CLASS Homer AS Custom
>PROC Speak
>   = MESSAGEBOX( "DOH!" )
>ENDDEFINE
>
>DEFINE CLASS Duck AS Homer
>PROC Speak
>   = MESSAGEBOX( "Quack!" )
>ENDDEFINE
>
>DEFINE CLASS Pig AS Homer
>PROC Speak
>   = MESSAGEBOX( "Oink!" )
>ENDDEFINE
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform