>>>>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.
>>>
>>>Dmitry,
>>>
>>>Let me add to what Craig told you.
>>>
>>>It appears that you're using the form class in order to have access to the dataenvironment and private datasession. However, in a typical n-tier design, is something like this:
UI < -- > BO < -- > Data
The double headed arrows show the communication path.
>>>
>>>You can achieve a private datasession via the session class, and, in VFP 8.0 have the ability to sub-class a dataenvironment independently of a form.
>>
>>George,
>>I understand what you are saying. Since I am making just baby steps in n-rier application I thought, at this phase, I would combine BO and DATA in one tier. Basically, I want to keep all code in the same place rather than all over the UI methods. And since I still work with VFP 6 (even though I have VFP 8) I didn't know of the private datasession independent of the form feature.
>>
>>Thank you very much for your help.
>
>Dmitry,
>
>You're welcome. The session object was introduced in VFP 6.0 SP3, I believe, so you at least should have access to that.
>
>Good Luck,
I have VFP 6.0 SP4 so I should be able to use it. Thank you!
"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