I am using ADO.NET, I have created DAL and BAL, structure is as follows
DAL
-POCO(Table to Entities mapping)
-Repository (Add, Delete, Edit, Select, Search)
BAL
-POCO(DAL to Entities mapping where Entities are complex type here)
-BusinessManager(Validation and Business rules)
I will be exposing BAL using services. And multiple applications like Web, Window, Mobile will be consuming this BAL.
I am not sure where should Sql Transactions be started. Who is responsible for creating a complex entities.
e.g. Complex entity could be
Entity
-Entity Type
-Contacts
-EmployeesReporting
-ReportingTo
Now who should create an Entity? Is it a BAL or DAL. Where should SqlTransactions be started? How should I make these entities to support lazy loading as I am a supporter of Stored procedure and prefers to use one database connection per request