views:

25

answers:

1

Application I develop requires several data sources (2 RDBMS and one file storage) to operate. I'm going to incapsulate datasources with DAL library & Business Logic layer.

Would you personally create several DAL libraries (each per data source) and cooperate several DAL instances in Business Logic Layer or create monolith DAL library, that incapsulates all datasources application uses?

A: 

It's difficult to tell without more information but if there are going to be a lot of methods for each data source I'd be inclined to create separate DALs.

It is then possible other applications (only interested in one of the data sources) could re-use one of the DALs - they won't have to deal with unrelated methods/data sources.

More importantly, make sure you inject your DAL into the business logic layer so you can test the business logic layer without actually using the "real" data source.

Joe R
Totally agree. I'm going to incapsulate file storage hierarchy in one DAL with first-RDBMS-DAL assembly that closely deals with file data. But going to create second RDBMS-DAL as separate assembly.
Andrew Florko