Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need a design suggestion
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Need a design suggestion
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01350036
Message ID:
01350036
Vues:
54
Hi,

I am working on converting my application to work with either VFP or SQL Server. I have done conversion of several forms/tables and so far all worked well. Until I came across the following issue. Let me describe briefly (simplified) my design approach.

Table Maintenance Form.
Form calls a BIZ tier that calls DA tier that retrieves all or certain number of records from the database table. This is based on the table name property. For example, property name is TABLE_NAME. If the value is "MYTABLE", the records from this table are retrieve into a cursor. The form controls then are bound to the cursor. I use SPT method of calling either VFP or SQL Server. No CursorAdapter.

The above approached worked well on several tables. But now I need to convert two tables/forms that include one or two fields from another table. For example. Table MYTALBE has field FIELD1 that has a foreign field in another table and I need to include in the cursor one or more fields from the related/foreign table. Therefore, now instead of SQL Select having only FROM it has to have LEFT JOIN clause with one or more fields. I am trying to create an approach that will be "standard" for future tables/forms.

The way I thought of doing it is to add a property something like "FOREIGN_TABLE" where the related table name is specified and then to have a property "FT_FIELDS" where a string of fields from the foreign table to be retrieved. Therefore, if these two properties are empty, the code will work as before. If these properties have entries, the code will incorporate this foreign table and fields in the SQL Select.

My question is, do you think the above approach is reasonable? Can you think of a better method/approach?

Thank you in advance for any suggestions.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform