On Thu, Jul 17, 2008 at 9:05 PM, MB Software Solutions General Account
<[EMAIL PROTECTED]> wrote:
> Paul Hill wrote:
>> 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.
>
> Anthony Testi had once thought as you did, but you don't know the power
> of the Force!   Er, oh, wait...wrong storyline.
>
> Seriously though, Anthony struggled with how to represent this in the
> OOP-ist fashion, citing like you did that it's one record.  No, it
> doesn't have to be that way.  Simply recognize the business object as
> the mediator between the UI and DataObject in that it's responsible for
> chaining along requests from the UI to the DataObject and passing back
> messaging and cursors from the DataObj to the UI.  It also functions to
> validate data, or your business rules, thus the name.

Thanks for the tips guys.  I've been thinking about this a lot over
the weekend and it's starting to make sense.
My problem was that I was getting my business class and data class a
bit mixed up.

BTW this is a c# project, not fox.  I'm just trying to get my head
around c# it's not a commercial project (yet :-).

-- 
Paul


_______________________________________________
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