|
-
Jun 14th, 2004, 08:47 AM
#1
Thread Starter
Frenzied Member
Classes and methods in business tier?
I have a method in my data tier which returns a dataset of all the contacts. In the business tier I have Load() and Save() methods in the Contact class. When I save a contact I simply read the data from the presentation tier into a contact object and persist that contact to the data tier (via the business tier Save() )
But when I need to list all contacts ina datagrid, should I then write the Load method in the business tier so it returns a dataset? Or is there better way? I kinda jumps one step when I don't set the properties of the contact object... Things like error controling and such.
But if I load all data into an object, how can I then bind that object to the datagrid? Perhaps I need to implement some kind of interface that I can use in the Load() method? I want to write;
dim dg as new datagrid
dim con as new contactcollection()
dg.datasource = contactcollection.load() <--- I don't want to return a dataset but rather a collection of contact objects, loaded from the database... and that have been filtered through the properties of the object.
I think my contactcolletion need to implement some knd of interface that allow me to bind it like that..?
kind regards
henrik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|