If there was a line of business application layered like this, would this be an appropriate division of labor :
Data Access
Invokes only stored procedures, maps properties of DTOs to a hash tablse which are used to populate ADO.NET command's parameter collections.
Only assembly with reference to SqlDataClient.
- Significant logic dealing with what means blank, null, and empty in the mapping code, but other wise no validation or other domain specific logic.
So-Called Business Logic
splits multiple result sets into individual DataTables, e.g.
public void ReturnNthRecordSetFromStoredProcFoo()
pass through to data access for datasets, e.g.
public void ReturnDataSet(string name){ return (new PersonController).GetAnotherDataSet(name);}
maps one row of a DataTable to one DTOs
- Significant logic dealing with what means blank, null, and empty in the mapping code.
- Holds transaction object, although it is used exclusively to wrap single stored procedure calls.
- Doesn't have a reference to SqlDataClient, so it can't use SqlDataReaders to fill DTOs
- No reference to System.Web.UI
- Authorization rules, but otherwise no domain specific logic.
UI
- 2 way data binding of DTOs to ASP.NET forms.
- Validation of properties of controls- generally no validation directly against DTOs
- "Collections" are navigated by binding DataSets to grids. In fact attempting to do anything with collections requires the UI to iterate over DataRows in DataTables and know what the appropriate column names are (which are generally only kind-of-similar to the DTOs)
So the question, finally-- with this application, should the Data Access Layer assume the the duties of the so-called business layer be merged? Isn't this already a two layer, (almost one!) application except for the inconvenience of an extra assembly?
Additional info: Ok, I already know that the application server will be one machine, probably forever, since it is an low-user-count intranet app. So I know not to design for physically separate application tiers. Also, it will probably only support one UI and be entirely scrapped if it ever need to support something other than ASP.NET-- another oft quoted reason for tiers/layers.