Questions tagged [controller]
The controller tag is used with questions involving the controller component of the Model View Controller (MVC) design pattern. The controller component accepts input, usually from a user interface, and issues various change and modification requests to the model component and/or the view component controlling the data of the model and how the data is presented. In some cases controller and view are combined into a single component.
38 questions
1 vote
4 answers
156 views
Is it good practice to return ApiResponse from a Spring service layer?
I'm working on a Spring Boot application with a VoucherService and VoucherController. I currently have the service method return an ApiResponse<T> directly, like this: @Transactional public ...
1 vote
2 answers
231 views
Entities can move from one Clean Architecture use case to another using the controller?
I'm working on a project with the task of creating a route to checkout ticket purchases for events. In this scenario, I have a controller that receives the request with order data, client information, ...
2 votes
4 answers
937 views
Can the presenter talk to to the controller?
in the clear architecture, what uncle bob suggested. I have a lot of questions about how to correctly distribute the responsibility. it seems that there is no relationship between controller and ...
1 vote
2 answers
151 views
How to properly implement Rest Controllers to handle overlapping entities?
I have: A User entity. A Poll entity. Relationship: User creates polls. Use-case: When an arbitrarily user is clicked his/her profile is loaded and shown. The profile includes a list of polls ...
2 votes
2 answers
3k views
Should a single method in a service class perform multiple operations for its controller?
Let's say I have a controller called MessageReceiverController which is a controller of an API that other services can call and include messages in the requests. For each of the messages the ...
3 votes
3 answers
991 views
Does the Controller contain get methods in MVC?
I am at the stage of implementing a my 1st ever view, after developing a Model and Controller, however there is a problem. I have been reading this article on MVC, which is what I have been aiming ...
8 votes
2 answers
2k views
Separation of concerns and other best practices across Controllers, Services, Providers and Stores in ASP.NET when building a REST web api
I am traditionally a desktop app developer, but circumstance has thrust me into the role of doing web client and corresponding REST api logic for a project I am involved in. Unfortunately, I'm a one-...
0 votes
1 answer
118 views
Is my typescript controller overloaded?
I'm building a rest API using typescript and typeorm as orm. Each route of my API point's to a specific method located in a controller class. My question is about the content of this controller ...