I have used NHibernate successfully in the past and want to use it again. I have a modeling question...
If I have a 'Company' object, which has a collection of 'Employee' objects. All fine, except, when there are 50000 employee's. What are peoples recomendations for modeling this? If I want to page through the employees, do I manage the paging in my service layer?
The way I am currently thinking is:
UI --> Presenter.LoadPage(companyId, pageNumber);
Presenter --> ServiceLayer.GetCompanyAndEmployees(companyId, pageNumber)
ServiceLayer --> RepositoryWithHibernate.GetCompany(1) & apply employee filter
Not sure I like it though, any thoughts? What other options do I have? I have seen some info from Udi Dahan on fetching strategies, but this seems to add datalayer knowledge into my service layer. Is this the only way to go.
Thanks for any comments
Tim
|