Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Visual Editing of business class w private datasession
Message
From
22/12/2009 21:43:42
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01440258
Message ID:
01440288
Views:
39
Nadya --

Finally, part of this discussion I fully understand -- both of your points are well taken.

As it happens, for BO's that I would be adding to a form, using the form's datasession would be satisfactory, so that wouldn't be an issue for me.

And, as to your second point -- the BO's which I create as session wide are so few that they are unlikely to cause much of a fuss either.

I think I'll try this, see how far it gets.

Thanks,

Jim


>1. You would not be able to drop your Form's Based BO to a form.
>
>2. The BO based on form will take longer to instantiate/destroy and if you need many BOs it can have noticable effect.
>
>>Nadya --
>>
>>Could you please explain a bit about what too complex an object to be a good candidate for the BO. means?
>>
>>Sure, it's good a boatload of properties and methods. Why do I care?
>>
>>Jim
>>
>>>Form is too complex an object to be a good candidate for the BO.
>>>
>>>In MereMortals BO were based on line, but they share the DS of the caller.
>>>
>>>I created a BO class based on session, but I worked with it in a prg. I didn't find it too complex.
>>>
>>>>Nadya --
>>>>
>>>>That confirms more or less what I had come across on my own.
>>>>
>>>>I really would not like the kludge of having to handle switching data sessions -- but it wouldn't quite be as you said, would it? You'd actually have to switch to the new data session any time a method in the object was called from outside the object, and then back again when returning, correct?
>>>>
>>>>Actually, I have also considered basing it just on a form (which I would never Show). Is there some conceptual reason to avoid that approach?
>>>>
>>>>Thanks
>>>>
>>>>
>>>>
>>>>>Jim,
>>>>>
>>>>>Unfortunately, it's not an easy problem. The only suggestion I can give you is to initially design your class as custom and then convert to a prg and make changes in a prg since then.
>>>>>
>>>>>There is no other session based class. You can, of course, create a session class in the init of the custom class and switch DS to it and then restore DS in the destroy (and destroy session based class there), but IMHO, it's a bit of a kludge.
>>>>>
>>>>>>Howdy, all --
>>>>>>
>>>>>>I have just begun a more concerted effort to incorporate business classes into my apps (yes, I know, its very long overdue).
>>>>>>
>>>>>>I already had about a dozen or so classes in my various apps that were created in PRGs and defined as Session. This allowed them to have private datasessions (which, actually, was the only reason I created them in the first place).
>>>>>>
>>>>>>I find the editing capabilities in a PRG kind of cumbersome -- I'd like to be able to save a class in a VCX and use a tool more familiar to me, PEM Editor. This would provide a few niceties not available in PRG-based classes -- opening each method in a separate class, for instance, or seeing parent code.
>>>>>>
>>>>>>However, one thing stumps me. I can't create a class based on Session in a VCX, and a class based on Custom does not have a private datasession.
>>>>>>
>>>>>>To make this a little clearer: I'm looking for a way to create a business object, stored in a VCX, so that it has a private datasession.
>>>>>>
>>>>>>Any suggestions on what I can do?
>>>>>>
>>>>>>Thanks in advance,
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform