I'm new to web application development, and aiming at designing an application which will serve both browsers and mobile devices which will consume REST services to communicate with the server.
For this I think of creating 2 separate layers for web and rest. I follow the spring io getting started guides full tutorials (http://spring.io/guides#gs), which use an architecture that holds a domain package within the rest layer which constructs the objects that will be sent as replies to rest requests.
In another web tutorial they have a similar package under web layer for handling the domain objects prior to displaying them.
I read this question and if I follow the general guidelines in the answer, I would implement separate domain packages since even if the view layer uses REST, there are still some differences which might be a source of maintenance problems should I decide to change something in the future: (Best Practice - Multi Layer Architecture and DTOs)
My question is regarding an application that has both, should the web layer hold DTO's like the rest one, or is it a good practice to have the views call the rest services or use the same rest.domain.POJOs (and extract these POJOs from that package to a common one?
Thanks.