The controller tag has no usage guidance.
0
votes
0answers
48 views
When splitting a Node.JS server between model and controllers, who should tranform the data for the database to understand?
I have a node.js server for an API that is split between controllers and models (there is a router which is autopopulated on runtime). So for example here is a classic end point for fetching config ...
0
votes
1answer
257 views
Controller calling multiple services
I have a few layers in my WebApplication: Presentation, Service, DAO, Domain.
Services call DAO objects which reads data from a Database/File whatever.
I have a Controller that needs to fetch data ...
2
votes
3answers
158 views
Is Model a better place to set HTTP status code?
In MVC usually the controller sets whatever needs to be sent back to the client/View, including HTTP status code, e.g.:
class Controller {
public function get(Request req, Response resp) {
...
3
votes
1answer
80 views
where to put methods that manipulate objects
I have a controller method as follow:
public class RoomsController {
@RequestMapping(method = RequestMethod.GET, path="/v1/rooms/{name}")
public ResponseEntity<?> getRoomInformation(@...
1
vote
2answers
176 views
Should controller layer create model objects or they should be created by service layer?
I have a small application with classic layers Controller-Service-Dao. Controller actually is REST resource, which deals with JSON data. And the questions are:
1. where is the best place to create ...
1
vote
0answers
27 views
Does RaceDataFacade violate the single responsibility principle?
I have heard, that each class should always just be responsible for a single purpose, otherwise you should rethink your design.
So here are the concerned classes:
WebSocketController: provides ...
1
vote
1answer
22 views
MVC Set or Read View Components
I often see the follwing example when reading about MVC (example is in Java, but question adapts to all OOP languages):
class View{
JTextField tfName;
public String getTfNameText(){
...
2
votes
2answers
291 views
writing a controller file in Python
I need some advice on my idea to write a controller file in Python, and not like the C in MVC type controller but a more simpler idea. Just a Python script that controls the operation of some other ...
0
votes
2answers
279 views
In AngularJS - should $resource be used from controller or service?
All the documentation, examples and tutorials I've found on $resource were using it directly in the controller. So far I'm just using $http from services and those services are further used in the ...
0
votes
1answer
126 views
PHP MVC concept large controller
I have custom MVC framework in PHP and my controller file has about 5000 lines.
The question is, is it a big concept flaw?
It is structured code with kiss method and quite maintainable.
Are there ...