Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Victor Campos article
Message
From
07/01/2002 11:01:50
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00601274
Message ID:
00601502
Views:
15
><< 1) The session-object is typical vfp7.0 I supose. Because I don't have vfp7.0 I replaced this with form. They both have a datasession. >>
>
>Yes. That is correct. The Session Object is also available in VFP6 SP3.
>
><< 2) The thing I asked in my prev. messages was. Is it possible to write a method that returns something like a query?
>ex. thisform.grid1.recordsource=Getorders(getcustomersId()) >>
>
>Technically, you can't return a query. You can however return the alias of the source (query, cursor, view or table). But yes, it would make sense to call a method in the Business Object that would open the data source and return the alias in order for your grid to function correctly.
>
>The example you show above does not require that the Business Object to call a method within itself to get its own property value. There's nothing wrong with using a method for a Business Object to get it's own property value especially if it's being called from several methods. But if it's being used by only one method why bother writing another method to access the property. The purpose of writing Set's and Get's is to the protect the values from outside the Object's encapsulation.
>
>Instead, I would imagine that you're passing a value to the mehod.
>
>ex. ThisForm.Grid1.RecordSource = ThisForm.oBizObj.GetOrders(liCustID)
>
><< 3) If I use methods like Getcustomername() and a fieldname or businessrule changes, I only have to replace this in one method! >>
>
>Correct. This is the very reason why you would want to this. Encapsulation is the key to normalizing your application. You can't go wrong when using this methodology.


Thanks for your help.
Previous
Reply
Map
View

Click here to load this message in the networking platform