Paul,
You simply need to treat the BizObj as a funnel to pass data back into a VFP
Cursor. All the Bizobj will do is allow you to disconnect the UI from the
Dat Access Layer. It doesn't have to be a strictly 1:1 relationship between
the UI and the BizObj however.

Use the power of VFP and its strength by using a VFP cursor to feed into.
The only thing you need to be careful of is when you use the data in the
cursor to make changes before you have refreshed it as the data may well not
be present in the actual data store. However, this is fairly simple to
handle as long as you can leave the VFP concept of editing data on the fly
on the shelf and resort to a more mainframe approach of selecting data then
retrieving the latest copy of it from the datastore immediately before
editing it.

Good planning and standardisation of operation makes this a fairly simple
exercise. The biggest only difficulty I found was having edited the relevant
data in a form and written it back to the datastore, to return back to the
VFP grid in exactly the same place (i.e Relative Grid Row number) without
excessive screen disruption.

Dave Crozier
 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Paul Hill
Sent: 17 July 2008 20:26
To: ProFox Email List
Subject: [NF] Business class Q

Hi All,

I've been thinking about n-tier design...

I have a business class.  This class has properties for all the
underlying database fields.
There's a method called GetByID() that fetches 1 record based on the
PK for that table.

Great.  I can update the properties and call Save() which sends an
update to the SQL table.

But suppose I want to search for a range of records.
So I have a method called GetBySurname() that can return multiple
records.  This method returns a Recordset/array/SqlDataReader etc.

But this doesn't really 'fit'.  The business object represents 1 record.

What's a nice solution?
One way would be to implement SkipNext() & Eof() methods that let you
move through the data, but sometimes I want a Recordset if I'm passing
the data to a grid.

Thoughts?

-- 
Paul


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to