S
Steve
I'm designing my data access needs and have a couple of questions.
First of all, I can't get a straight answer what a "business object" is. I
typically create classes to represent my database tables, are those
"business objects"?
Is it more typical to pass the business objecs to the DAL methods or have
the business objects generate correct SQL and pass commands to the DAL?
I'm thinking of trying out a new type of business object where I encapsulate
a DataSet or DataTable in my object. Something like:
<code>
class BCustomer
{
private DataSet m_rawData;
public string CustomerName
{
get{ return m_rawData.Tables[0].Rows[0][0]; } // assuming
this is the index to the customer name?
set{ m_rawData.Tables[0].Rows[0][0] = value; } // ditto
}
}
</code>
This gives me strong typing and the flexibility of the DataSet/Table
Is this common? Anything I should know?
THANKS!
First of all, I can't get a straight answer what a "business object" is. I
typically create classes to represent my database tables, are those
"business objects"?
Is it more typical to pass the business objecs to the DAL methods or have
the business objects generate correct SQL and pass commands to the DAL?
I'm thinking of trying out a new type of business object where I encapsulate
a DataSet or DataTable in my object. Something like:
<code>
class BCustomer
{
private DataSet m_rawData;
public string CustomerName
{
get{ return m_rawData.Tables[0].Rows[0][0]; } // assuming
this is the index to the customer name?
set{ m_rawData.Tables[0].Rows[0][0] = value; } // ditto
}
}
</code>
This gives me strong typing and the flexibility of the DataSet/Table
Is this common? Anything I should know?
THANKS!