Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass data from one object to another
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00589517
Message ID:
00590232
Vues:
33
Michelle,

It seems you may be confusing abstract design issues with concrete implementation issues. In the abstract design you have;
  |---------|       |-----|       |-----|
  | form UI |<----->| LDA |<----->| RDA |
  |---------|       |-----|       |-----|
Each services is provided by a different object. However you can implement this using a more complex set of objects, like;
                 |------------------------|
  |---------|    |  |-----|       |-----| |
  | form UI |<-->|  | LDA |<----->| RDA | | <-- Data access object
  |---------|    |  |-----|       |-----| |
                 |------------------------|
In this scenario the Data access object is what your form interacts with. The RDA and LDA are components of the Data access object. Since the LDA and RDA are siblings as children of the same parent they can be tightly bound to each other.

Why keep two objects for the data fetching? Because the RDA will need to be specialized to the variety of data sources you need. Its job is to fetch data and convert it to a common format for use by the LDA. The LDAs job is to receive data from the RDA and format it properly for the current UI. The LDA also does the reverse of getting data from an interactive UI and converting to a common format for use by the RDA.

This is the very common bridge pattern. The only time you will need to deal with anything other than VFP cursors between the RDA and the LDA is if you have them remote to each otherike in a web base app. In a web based app you are stuck with moving the data arund as plain text because that is how the web works.

Hope this is helpful.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform