Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
3 views

Where do JavaFX FXML controllers belong in an ECB architictural design pattern?

I am wondering where does the fxml controller belong in the Entity-Control-Boundary model? When designing a JavaFX application with the help of Scene Builder, Scene Builder generates an fxml file ...
-5
votes
1answer
47 views

What beneficial software engineering principles are invoked when using Request Handlers instead of Controllers in context of MVC software pattern?

Request Handler - a controller with a single action. Controller - a class with one or more actions. What are the beneficial software engineering principles that are being utilized when using Request ...
0
votes
0answers
19 views

Provide user access on credit card transaction

I'm sorry if it's not a correct type of question to ask on this form, I just don't even know the name of the concept I lack understanding in. Basically I have a database where users have access to a ...
0
votes
1answer
48 views

What's the best approach to write chronology entries on certain actions in ASP.NET Core MVC?

I'm working on a software product that entails users opening up a case and taking actions to process the case, changing the status, creating tasks, etc. I'd like to provide a history of the actions ...
0
votes
1answer
177 views

How to design thread safe class when separating business logic from POCOs

I like to separate business logic out of POCOs into controllers. If an object must be thread safe, where do I put the lock code? In the POCO itself? Or in a controller? Might make sense because ...
2
votes
0answers
71 views

Packages, a controller class, and coupling vs cohesion

So I'm building my first application, in Python, and some issues have cropped up because of the lack of interfaces (I.e. explicit type declaration) My design involves several homebrew packages, and I'...
0
votes
0answers
245 views

REST API standards to include method in Controller or service layer

We are using REST API with Spring MVC to develop endpoints. I have a question related to method location (controller layer or service layer). Controller has a get() method which accepts some ...
0
votes
1answer
527 views

Controller and API DTO Architecture and class organization in .net core with microservices

We are developing a system with coarse microservice architecture. We have an API that uses controllers and back-end logic with Entity-Framework repository, and several types of clients that use this ...
0
votes
1answer
579 views

Is it possible to add Service layer in MVC pattern?

I'm working on javaFX project using Hibernate and H2 database,I'm trying follow the concept of MVC design pattern ,so I have created 3 packages : models :contains POJO classes 2.1 views.fxml:...
1
vote
1answer
141 views

What alternative name to give to controllers?

There are several posts and other contents in the internet that claims against naming classes ending with "er" (like manager, controller, helper...). I personally agree with that, but what ...
2
votes
1answer
151 views

Spring Restful API - Controller strategy

We are developing a new REST Api for our Spring MVC legacy enterprise web application (before this it was communicationg with Adobe Flex frontends). As a general rule we stated that we were creating ...
4
votes
1answer
132 views

Should a Controller have a Model object as an attribute?

For context, this project is a personal budget program I am working on while I try to learn to use MVC patterns effectively. There is a SessionController that passes user commands to a ...
0
votes
1answer
1k views

When to have more than one controller class?

Would it be correct to assume that in general, I would need as many controller classes as classes that can be accessed/modified by a user? For example, If a logged-in user can add/modify to a class ...
1
vote
2answers
345 views

MVC: how to design interface for database

I'm a newbie on web development and I've heard about MVC. If I'm right, it's the Controller that take charge of fetching data from DB. So I have a question: In the pattern MVC, how many objects to ...
1
vote
0answers
123 views

Inversion of control in controller by a mediator

A user has to perform a somewhat complex task on my website (submitting a rating). For the sake of example, let's consider it's a rating for a movie, done through a controller. There are several ...
0
votes
2answers
265 views

Abstraction from database - handling ID types

I am using MongoDB in a project, where relationships between collections are created via referencing a unique document ID of a special BSON ObjectID type. So I can have a School document like this: {...
5
votes
1answer
16k 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 ...
5
votes
3answers
1k 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
109 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(@...
2
votes
2answers
2k 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
33 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
36 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
3k 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
533 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
219 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 ...