UI, BLL and DAL
-
Hi, I'm trying to come up with the architecture for my new project. It's a window form based application with a SQL Server backend. I would like to use a multi-tiered approach with the database, a data access layer, a business logic layer and a user interface layer. The structure of the solution is as follows - DAL (Class Library) - BLL (Class Library) - UI (Window form application) From what I understand, the UI should not have access to the DAL (except via the BLL), so there should be no reference to the DAL in the UI. Wright ? I use the "TableAdapter Configuration Wizard" to generate my DAL code, which sometimes returns typed datatables. The businesslogic layer returns those same typed datatables that were defined in the DAL. I'm setting the data source of a gridview to that typed datatable. This requires that the UI know something about the datatable defined in the DAL, so to make this work I have to place a reference to the DAL in my UI layer, which I supose is not good programming practise. How should this be done ??
-
Hi, I'm trying to come up with the architecture for my new project. It's a window form based application with a SQL Server backend. I would like to use a multi-tiered approach with the database, a data access layer, a business logic layer and a user interface layer. The structure of the solution is as follows - DAL (Class Library) - BLL (Class Library) - UI (Window form application) From what I understand, the UI should not have access to the DAL (except via the BLL), so there should be no reference to the DAL in the UI. Wright ? I use the "TableAdapter Configuration Wizard" to generate my DAL code, which sometimes returns typed datatables. The businesslogic layer returns those same typed datatables that were defined in the DAL. I'm setting the data source of a gridview to that typed datatable. This requires that the UI know something about the datatable defined in the DAL, so to make this work I have to place a reference to the DAL in my UI layer, which I supose is not good programming practise. How should this be done ??
-
Hi, I'm trying to come up with the architecture for my new project. It's a window form based application with a SQL Server backend. I would like to use a multi-tiered approach with the database, a data access layer, a business logic layer and a user interface layer. The structure of the solution is as follows - DAL (Class Library) - BLL (Class Library) - UI (Window form application) From what I understand, the UI should not have access to the DAL (except via the BLL), so there should be no reference to the DAL in the UI. Wright ? I use the "TableAdapter Configuration Wizard" to generate my DAL code, which sometimes returns typed datatables. The businesslogic layer returns those same typed datatables that were defined in the DAL. I'm setting the data source of a gridview to that typed datatable. This requires that the UI know something about the datatable defined in the DAL, so to make this work I have to place a reference to the DAL in my UI layer, which I supose is not good programming practise. How should this be done ??
Having data classes bubble up from the DAL shouldn't be a problem; but, as Shameel said, defining them in a separate place is even better.
paper67 wrote:
I use the "TableAdapter Configuration Wizard" to generate my DAL code
I prefer to roll my own and maintain control.
-
Hi, I'm trying to come up with the architecture for my new project. It's a window form based application with a SQL Server backend. I would like to use a multi-tiered approach with the database, a data access layer, a business logic layer and a user interface layer. The structure of the solution is as follows - DAL (Class Library) - BLL (Class Library) - UI (Window form application) From what I understand, the UI should not have access to the DAL (except via the BLL), so there should be no reference to the DAL in the UI. Wright ? I use the "TableAdapter Configuration Wizard" to generate my DAL code, which sometimes returns typed datatables. The businesslogic layer returns those same typed datatables that were defined in the DAL. I'm setting the data source of a gridview to that typed datatable. This requires that the UI know something about the datatable defined in the DAL, so to make this work I have to place a reference to the DAL in my UI layer, which I supose is not good programming practise. How should this be done ??
In addition to the other comments I would consider Enity Framework for the entities and DAL. Place the former in a seperate assembly to be references in the other layers.
I know the language. I've read a book. - _Madmatt
-
Having data classes bubble up from the DAL shouldn't be a problem; but, as Shameel said, defining them in a separate place is even better.
paper67 wrote:
I use the "TableAdapter Configuration Wizard" to generate my DAL code
I prefer to roll my own and maintain control.
-
So when I intend to keep the wizards autogenerated code, referencing the DAL in the UI layer to access the typed dataset, datatable and datarow types returned from the BLL is not so bad ??
As long as you access them via the BLL.