Y
yurps
Hello,
I want to create business and data access layer for my website. I am
not sure what the right way to go is, I could use a code-generation
tool, but want to understand a bit more about design.
Basically I have my DAL, BOL, & Website project....
in DAL I have the class OrderDB with a method called List()
which returns a collection object called OrderList which is
specified in the BOL project, where I have OrderList and Order
classes.
In DAL I have a reference to BOL, and in the Website I have a reference
to BOL & DAL. I fill my datagrid much like this...
OrderDB odb = new OrderDB();
OrderList ol = odb.List();
DataGrid.DataSource = ol;
DataGrid.DataBind();
However I could actually add another class to the BOL project, call
Orders which calls the OrderDB.List() as a static method returning a
IDataReader object (I am using Enterprise Application Blocks), then
there I iterate thru it and load my OrderList object and send it to the
UI tier.... so it would go
Orders ors = new Orders();
OrderList ol = ors.GetList();
DataGrid.DataSource = ol; etc..etc...
in this case I have a reference to DAL in BOL, and a reference in to
BOL in Website....this seems to be a better n-tier structure in terms
of referencing and passing thru the layers but does not seem to be the
case here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/BOAGag.asp
Any thoughts
I want to create business and data access layer for my website. I am
not sure what the right way to go is, I could use a code-generation
tool, but want to understand a bit more about design.
Basically I have my DAL, BOL, & Website project....
in DAL I have the class OrderDB with a method called List()
which returns a collection object called OrderList which is
specified in the BOL project, where I have OrderList and Order
classes.
In DAL I have a reference to BOL, and in the Website I have a reference
to BOL & DAL. I fill my datagrid much like this...
OrderDB odb = new OrderDB();
OrderList ol = odb.List();
DataGrid.DataSource = ol;
DataGrid.DataBind();
However I could actually add another class to the BOL project, call
Orders which calls the OrderDB.List() as a static method returning a
IDataReader object (I am using Enterprise Application Blocks), then
there I iterate thru it and load my OrderList object and send it to the
UI tier.... so it would go
Orders ors = new Orders();
OrderList ol = ors.GetList();
DataGrid.DataSource = ol; etc..etc...
in this case I have a reference to DAL in BOL, and a reference in to
BOL in Website....this seems to be a better n-tier structure in terms
of referencing and passing thru the layers but does not seem to be the
case here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/BOAGag.asp
Any thoughts