MVC is about having a controller that provides data (model) to populate the view it decides to display. In Hi-Framework controllers don't decide the view they want to show, they must simply provide the data populate a view because in reality, a controller has actions/methods that have their own meaning, giving a hint of the data manipulated/required in the "action" context. The way things are displayed is not a problem of the controller, its only problem is what do display. Calling a view is a decision out of the controller scope. The callView method invocation turns unit testing a very complicated mission on Hi-Framework based apps.
@Mapping("/order")
public class OrderController{
//Example: GET oder/item?id=12
public void item(@Map("id") String id, ViewScope scope){
Order order = //Fetch from whatever u want
scope.set("totalItems",order.getTotalItems())
.set("amout",order.getAmount())
.set("currency",order.getPayment().getCurrency());
}
}
Motivation
MVC is about having a controller that provides data (model) to populate the view it decides to display. In Hi-Framework controllers don't decide the view they want to show, they must simply provide the data populate a view because in reality, a controller has actions/methods that have their own meaning, giving a hint of the data manipulated/required in the "action" context. The way things are displayed is not a problem of the controller, its only problem is what do display. Calling a view is a decision out of the controller scope. The callView method invocation turns unit testing a very complicated mission on Hi-Framework based apps.