Hi, I'm a new architect. I've designed service layer that contains services such as getAllCustomers(), findCustomerByLocation(String location), getAllOrders(), findOrdersByDate(Date startDate, Date endDate), etc..
When I tried to implement the presentasion layer, I find out that I need pagination service. But most presentation layer supports for pagination requires me to fetch all records from DB, and I fear this could cause some performance problems.
I could modify my DAO layer to support pagination in Hibernate. But that mean I will need change my service layer and my DAO layer to include 'pagination' parameter. I feel that 'pagination' is not part of service and feel strange to add pagination parameter to all methods that require pagination. Are there any solutions to create a transparant 'pagination' that doesn't fetch all records from data source and without changing my service layer methods?