Существует ли шаблон проектирования или хорошо известное решение для разработки службы REST, в котором интерфейс приложения может вызывать один и тот же веб-сервис для получения различной информации об объекте.
Пример:
WebServiceFull.class
@PATH('/car/')
public Response getCarInformation(@PathParam('id') long carId) {
// Call Service/DAO
// return the complete Car Object (may contain 50 properties for instance (color, size, age, factory, brand, ....)
}
Что мне интересно, если возможно / хорошо:
WebServiceWanted.class
@PATH('/car/')
public Response getCarInformation(@PathParam('id') long carId, @QueryParam('info') List<String> infoWanted) {
// Call Service/DAO with the List
// Browse through the given list to only get from DataBase the needed info
// return the partially complete Car Object
}