Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is a 'warper program'?
Message
De
29/11/1999 11:31:38
 
 
À
28/11/1999 21:27:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00295884
Message ID:
00296385
Vues:
23
Hi David,

>Let's hear *your* definition of a wrapper -- with examples, including one that deals with "existing code".

Say you have a prg with two function in it. This would be a wrapper for that PRG:
define class MyWrapper as Custom
name = MyWrapper

procedure Init
    set procedure to MyPrg.Prg
endproc

procedure Func1
    return Funct1InMyPrg
endproc

procedure Func2
    return Func2InMyPrg
endproc
enddefine
There, that wraps a new object interface to existing code with out changing the exisitng code at all. The old code shouldn't be changed, then your not wrapping, your modifing, and most of the times it can't be, either, its not accesible, or it needs to backward compatible.

Another exapmle would be a wrapper to an ActiveX (a subclass, or third object that controls it externally) , where you can't play with other code, and there are too many Gory Details to do everything over each time you need it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform