I have a UI that needs lots of information. Most of the information has been identified as separate entities in database. For example, displaying the details of an Employee. The UI page might be Employee details with various sections regarding Employee Information such as Personal Details, Address, Contact details, Project Details etc.
So if we derive the entities for the same requirement, we will have following tables
Employee
Address
Contact
Project
We will be implementing repository pattern in DA layer, and ASP.Net Web API as our restful service layer.
So, now if i need to display Employee details in the UI, what should be the best approach. What i was thinking is mentioned below.
Approach
There will be a single call to Web Api to get the Employee details. Internally it will connect to database multiple times to get Employee details, Address information, Contact information, Projects information etc and populate into one EmployeeDetailsModel (a kind of viewmodel) and return this as a JSON.
Is this a good approach ? If there is any other better approach please suggest