Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Business objects newbie question
Message
 
 
À
31/03/2004 12:28:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00891196
Message ID:
00891222
Vues:
15
Maybe I did't explain myselft clearly. I was thinking of creating BO based on the form (but not data entry form) so that when data tables are opened within BO they would be handled in private session. And as you suggested, I would then instantiate the BO class in INIT of the data entry form. I thought that if I use a custom object as a base for BO class, the data would not be "encapsulated". But maybe I should rethink it.
The question I had in my mind, mostly, when I posted the message is if it is correct to create a property for every field of the table where the data will be saved.
Thank you so much for your input.

>Pretty close, but you are linking the UI with the BO. Use a custom object for the BO then drop it on the form. Or, use a session object and instantiate it with CREATEOBJECT() in the Form.Init. The UI should only display information. All the smarts will be in the BO.
>
>>I am thinking about how to create business objects (to paraphrase William Hunt, “I don’t have a formal computer training” <g>) and would like to know if I am on the right track.
>>
>>The following is a very simplified example.
>>
>>Say, I want to create a business object for conference room reservation program. One business object I will need is Reservation Class/Object.
>>
>>I think I will need to create a class (in VFP, based on a form class so that it would have private data session) with custom properties such as:
>>Room No
>>Reservation Date
>>Time From
>>Tim To
>>Reserved For
>>Etc.
>>
>>The class would also have methods, such as:
>>Check if room already booked
>>Save reservation.
>>
>>Here how the business object will be used:
>>1. User enters information into a data entry form.
>>2. Data entry form creates an object of the Reservation Class.
>>3. Reservation Class object properties are then set with values from data entry form controls.
>>4. Reservation Class method “Check if room already booked” is called.
>>5. Reservation Class method “Save reservation” is called.
>>
>>Would the above description be “in line” with how to create business objects with VFP?
>>
>>Thank you for any comments. Also, if someone wants to recommend a basic/beginners book or a white paper on creating business objects, I would appreciate very much.
"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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform