I want to populate data into the model from inside a controller.
Suppose there is a controller method fetchResponse(Task task) That takes some Task object...
and returns a json TaskResponse object.
now here could be one implementation :
fetchResponse(Task task @(RequestParam))
TaskResponse taskResponse = new TaskResponse(task);
return serialize taskResponse.
This is one way in which all the attributes of the TaskResponse object will be filled inside the TaskResponse object which will be serialized and sent .
Please suggest any pros and cons of this aproach... Also any alternatives.