Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OOP Design
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Divers
Thread ID:
00198504
Message ID:
00198667
Vues:
20
I have a mediator that calls a class called Updator. Updator updates a given field. The problem is that I have *multiple updates* to do. The exact number and process of the updates will vary depending on the specific situation.
>
>How do I structure the mediator and Updator so that the 'Updator' process gets called the proper number of times?

Hi Ellen,
A couple of questions:
1.) Which objects in your system know what fields need to be updated?
2.) Have you looked at the Iterator and Visitor patterns?
If there are objects(call them 'process objects') that know which fields need to be updated in a given situation, then you could iterate through them and either:
a.) Pass a reference to your visitor into the process object and have it call the appropriate methods to update the data
- Isolates knowlege of fields to update to the process objects
b.) Pass a reference to your process object to the update object and have it iterrogate the process object to determine which fields need to be stored, what their values are and update the data
- Requires a more complicated update object then option a.)

HTH,
Ned
Ned

Reality is.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform