Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OBJEXIST()
Message
De
27/12/1996 10:20:37
 
 
À
27/12/1996 10:11:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00016055
Message ID:
00016066
Vues:
48
>I agree with you that It appears to violate encapsulation. But many of the objects we create are affected by the class objects we design. This follows the same principal. In this situation. The LAST command button needs to test for the existence of the NEXT button. If the NEXT button does not exist the LAST button still performs all of its intended functionality. Placeing the code in the button as opposed to the container allows for maximum reuseability of code, and eliminates the dependency on the container for controlling objects. This actually seems, at least to me, to be a better method of encapsulation, especially since, the command button can now fully accomplish its purpose whether or not the second button exists and whether or not a container wraps the two buttons together.

what I would do for this scenario is create a "next" butcon
and a "prev" butcon that are not related and function alone
then i would use a subclass of each in another container and add the interaction capabilities (e.g. in a navigation bar)

Arnon
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform