dimanche 26 février 2017

Designing DAL and BLL - Single/Multiple Data Repository for the Related Tables

While designing a new multi-tier application, I am facing difficulty making a decision for my DAL and BLL layer design.

Suppose I have Employee information spread in multiple tables having both 1-1 and 1-Many relationship with master table. Few are listed below:

Employee (Master Table), Employee_Contact_Detail, Employee_Education, Employee_Skill, Employee_Experience

At DAL level, I have a generic data repository providing common functionality like GetAll, GetSingle, Add, Edit, Delete for each table.

Now, should I design my “Employee Data Repository” derived from my “Generic Data Repository” and add functions for all related tables listed above in a single class like GetEmployeePersonalDetail, GetEmployeeContactDetail, GetEmployeeEducation, AddEmployeePersonalDetail, EditEmployeePersonalDetail etc. In this way I would gain very less benefit for “Generic Data Repository”. The other way is that I create (and derive from Generic Repository) a separate data repository for each table and then create a single class at business logic layer for “Employee”.

Thank you very much for your guidance.

Aucun commentaire:

Enregistrer un commentaire