Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Business Objects, what base class to use
Message
De
25/06/2004 11:50:45
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00916597
Message ID:
00917266
Vues:
12
Hi Jamie,
I tend to use arrays in populating combos in the UI, but I also use lots of user editable grids for data entry.
Some think that a BO must project the data as properties. With SCATTER NAME you can always convert to an object to hold the data, or XML, etc., so I don't think it's a big deal--for editing I use cursors. The main issue is having each layer just do it's job and no more.
For example, I might use a DE class to hold a bunch of related views that I'm interested in displaying and editing. It also holds validation class(es) that know how to check the data. There nothing that calls for UI in the class. Nothing that's related to creating a form or navigating to a record.
The form has some navigation controls. A combo control, for example, gets its data from a class specified in the control's property. Just to keep things seperate, I might create that object in a private datasession, and use an array to populate the combo.
NavigationCombo properties:
-DataClass = "SomeClass, SomePRG_or_VCX"
-DataSession = 2 && Private.
In the Requery of the combo...
-This.Data.Requery()
-RowSource = "This.Data.aData"
This class will create SomeClass in a private DS and the combo consumes the data as an array. The data object, SomeClass, is unrelated to the DE stuff, or perhaps it's some of the same tables--that isn't important--it's job is to prepare the right set of data to allow the user to navigate to the KeyValue that is of interest. This class doesn't know it's used to supply data for a combo--it only knows that, given a set of properties, how to retrieve and prepare the data. The Combo doesn't know what form it's dragged onto. If I drag it onto the _SCREEN, it still works; showing the right choices available.

If I needed the data in another process or across the internet, I could transport it and theoretically not change all the logic involved in preparing and checking it. But since I'm in VFP, I am free to tranport the data as a cursor; I just have to be carefull to not cheat and do work in the UI that doesn't belong there.


>Hi Charlie.
>
>From your example below, does this mean that you don't use cursors in the UI but objects/properties/arrays instead ?
>
>How do you pass data from the BO to other classes/UI etc ?
>
>
>>
>>>Hi all, I use Session class for my business objects, but I don't really know if DataEnvironment class would be a better class (or any other for that matter).
>>>
>>>I'm seeking for advice on which class is more suited for business objects, and what are the pros and cons of using one approach or the other.
>>>
>>>Thanks,
>>>Javier.
Charlie
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform