main logo
Subject: Re: Best Practice - One BO do all ?
Author: Bhavbhuti Nathwani
Posted: 2002/07/12 01:16:10
 
View Entire Thread
New Search


Hi Lynette

The file is on the way, let me know if you don't receive it.

I took your advise and did the first split of my BO now I have 2 BO for mAccounts and more on the way based on the cursor which I manually created in the BO.

I'll try the others view thing tonight.

Thanks for the advise and I would appreciate the sample codes at venussoftop (at) postmark DO.T net


A Question: can we share codes between 2 different BO's?

<i><font color="#663300">
Bhavbhuti,

And I only check it when I have a CB specific problem! Usually I check UT or VFUG first because you get better response there!

I agree, coming from FoxPro to VFP myself, it has been a sometimes tough transition.... Finally, after a year of this, It's starting to sink in --- somewhat!

Anyway, you can make a view for a free table, I believe, you select other data sources when you create a new view..... something to play around with and see what works anyway. Once you create the view, then the BO is the same as any other BO based on a view.

It seems like you are making your BO's do a lot more work than I am. I use BO's to relate tables to each other and populate form fields --- PERIOD. I use methods on my forms to manipulate the data/biz rules for that form.

I try never to directly use a table. I either use an SQL statement to create a cursor, or use a view with a view parameter set.... to the parent key or unique table key --- each table has a MINIMUM of 2-3 views (one for itself as parent/standalone, one for reports only, and a third view with the vp set to the parent key if the table is a child table). Each view has a BO that is set specifically to work with that view and how it's filtered, etc.

I found this to be much easier than trying to make one BO work with different views and change things on the fly. Or worse, trying to make one VIEW work for many different situations.

Yes, it's more code and more to maintain, but it makes my life simpler. I know exactly where the breaks are -- and don't spend a day slogging through methods to find out where my code is changing my BO or view and causing a problem. I know exactly the behavior of each BO and matched view.

If you'd like some sample code, send me an email to ltillner@yahoo.com.

HTH

Lynette

<i><font color="#663300">Hi Lynette

I guess you are THE only other person who checks on this forum <g>

for Code Reuse will more BO help? basically a DOS guy so thinking in OOPs is bit difficult.

More so how to create a BO for a free table like repolist.dbf in the CBMETA dir?

<i><font color="#663300"><i><font color="#663300">Hi all

1. I have an bo_maccounts. This is used in the data entry for mAccounts and I have methods in this BO for generating lookup cursors based on the mAccounts table for use in the same data entry screen. Is it okay?

2. A few reports like Accounts Listing, Trial Balance will be based on the table mAccounts of which the above BO is derived. Should I make the bo_maccounts a do all or should I have a different BO for these reports?

3. Also Trial Balance is using other tables for generating current values, what should be the method with CB in mind.

Thanks all for responding to my previous queries. But the list seems to be silent these-a-days.
</font></i>

You couldn't be more right! This 'community' appears to be non-existent.

Anyway, my 2 cents is that I have subclassed BO's appropriate to the data that I am working with... child or parent (separate bo's) if the table is both a child and a parent I find that using more BO's makes my development life easier rather than trying to make fewer BO's do everything! I'm also extensively starting to use views where the relationship is already defined and the lowest child is the only updatable table... that is making my life easier too!

HTH

another lonely Codebook user -- struggling through

Lynette</font></i>

</font></i>

</font></i>

Regards
Bhavbhuti
 
©2002 Bhavbhuti Nathwani
<-- Prior Message New Search Next Message -->