I have read the following article from MSDN: http://msdn.microsoft.com/en-us/library/aa581779
It talks about creating a data layer, business logic layer and presentation layer and having naming conventions like getProductsDAL(), getProductsBLL() etc or even separating them into class libraries.
My question is: do developers follow this approach if .NET datasets are not used i.e. if youdo all the logic yourself e.g. have a function called getProducts, which connects to the database using a connection object and then loops through the resultset using an SQLDataReader and displays the results on the page. I am thinking about splitting functions like this into layers.
If you are set on doing it your way:
Your data layer will consist of methods that open a connection, execute a query/stored proc and return a dataset or datatable. This layer does not receive connection info from the layer above, and only returns query results from every method. Connections are instantiated at this level.
Your business logic layer contains methods that call one or more datalayer methods each. Example: Adding a new user also means setting up permissions for that user, so DL.InsertUser(params…) and DL.SetPermissions(int Userid, List permissions) is called by BL.AddNewUser(params…). This BL method could also call another DL method that gets a list of default permissions to assign the new user
Your UI Layer would call the BL.AddNewUser(params…) with all the appropriate new user details