Questions tagged [mvc]
MVC (Model-View-Controller) is a software architecture pattern that enforces separation of concerns.
955 questions
3
votes
3
answers
233
views
Best Practices for Implementing a Heartbeat Feature in a Laravel App to Track Offline Status
I'm trying to implement a heartbeat feature for offline tracking that just sends an offline message to the server once the web browser app (Laravel-based) is offline. Ideally it will ping the app's ...
0
votes
2
answers
606
views
How does the MVC pattern actually work?
I’m still a Computer Science student, and recently I’ve had to develop a project using the MVC pattern, but without having learned in depth about how it actually works. And it’s not the first time I’...
1
vote
2
answers
863
views
Best practice for using models between layers in mvc
I'm working on an MVC application using C#/asp. The project is following an n-tier architecture style with a separate data layer, domain layer and presentation layer. My question is related to the use ...
0
votes
4
answers
230
views
How to eliminate repetition in three subclasses: each defines an identical method that does almost the same thing, but with a different return type
TLDR:
I have three subclasses, each inherits from the same parent class, each defines an identical method that does almost the same thing, except that each of these methods has a different return type....
0
votes
2
answers
382
views
Do I use a model or controller in an existing MVC application for implementing an integration that makes API calls?
I have an existing application using Codeigniter Framework (MVC). I need to implement an integration in the software with the external cash register (e.g., making REST API calls). I need to either ...
-2
votes
1
answer
100
views
what are MVC benefits for my case?
I'm trying to design my new open source project I want to launch.
I want to be very careful with design/projecting because I had trouble maintaining software in the past.
I have code that works and ...
0
votes
2
answers
76
views
In which layer request parameter limit should be for an external endpoint?
I have a batch endpoint of the form
POST /entities
["id1", "id2", ...]
Where the endpoint takes an array of ids and returns a batch response.
Now I want to set a maximum value to ...
5
votes
4
answers
577
views
Does my outer class adhere to the Single Responsibility Principle?
I often write front end apps with a generic MVC pattern. I use javascript but this questions is language independent and relates to OOP as a whole. I struggle to understand the SRP principle and I ...
0
votes
2
answers
373
views
How can I achieve polymorphism if MVC logic is on the controller?
First, let me start by saying I’m a JavaScript developer but any conceptual advice I’d imagine is identical if not similar to when dealing with MVC.
During my learning, I stumbled across MVC and now ...
0
votes
1
answer
524
views
Multiple models/controllers python app
I am trying to tinker with the MVC pattern and I have a problem when trying to design the MVC structure. I need a model for products, however as I need to manage more and different data, I can help ...
0
votes
1
answer
119
views
Benefit of using Dependency Injection inside ASP.NET Core MVC
I am reading this article about using DI inside ASP.NET Core @ https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-6.0 .. but i can not understand its ...
2
votes
1
answer
134
views
MVC: Should View get strings of GUI components directly or should the controller pass strings to View?
I have an MVC application in Java with GUI components in a View class. The GUI has to support two languages, so texts on buttons etc. depend on which language was set at start up. Strings are in ....
-1
votes
2
answers
172
views
How to make domain objects accessible to MVC controllers and views?
Summary of my question in a short form: How to propagate changes of domain objects upwards without introducing application logic into them?
Following 'facts' are based on prescriptions from respected ...
0
votes
1
answer
742
views
Validation in both controller and my service classes?
I use the Laravel framework.
I've got controllers, like CustomerActivityController, and I've got a service layer with services like CustomerActivityService.
Say I want to create a new customer ...
1
vote
2
answers
434
views
MVC-like architecture: Model-Controller communication of results/status
I'm struggling on designing a solid architecture for my project.
In particular, I don't know how to handle the communication between the models and the controllers.
My goals are:
Following the ...
2
votes
1
answer
1k
views
In an MVC Application, What Goes Where?
In an Model-View-Controller (MVC) design pattern, What goes where? What code goes to model and to controller?
I know (do I?) that business logic should be define in a model, but a lot of example I ...
-2
votes
1
answer
58
views
Does Angular (or other frontend framework with auto UI update) break Single Source Of Truth since using function within template should be avoid?
I know when building an Angular app (or other frontend framework with auto UI update by change detection), using function in a template is not recommended since it will result in the function being ...
0
votes
2
answers
114
views
Where to sync Database and Search-Database in MVC pattern
I have a website-sideproject (Application Server: Django, Database: sqlite) with "search" functionality and I've recently stumbled over this problem.
When you have a full-text-search-...
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 ...
4
votes
2
answers
3k
views
Why do backend web frameworks use "MVC" when they have no persistent UI to update?
Model View Controller (MVC) is focussed on UI based applications. In MVC the model notifies the UI (view) when its values change and the view then decides what and if to update. I can understand this ...
0
votes
3
answers
336
views
How best to structure my Service/Repository layers when persisting a Many to One object?
I'm working on a project where I need to do CRUD operations on Book and Library objects. Naturally the relationship between Book and Library is Many to One, like so:
@Entity
@Getter
@Setter
@...
2
votes
1
answer
822
views
What would the database schema look like for a Entity Component System architecture of web app?
I found previous SE questions like this.
I'm familiar with the typical RDBMS backed MVC web app framework. To illustrate what I am thinking of, let's use the examples of Bunny and Carrot from this [...
0
votes
1
answer
99
views
In an MVC desktop application, is there a canonical solution to share an immutable value class between multiple components?
Question
In the context of an MVC, desktop architecture, is there a canonical solution or a design pattern / best practice to give access to an immutable value class to multiple components at ...
3
votes
3
answers
1k
views
RESTful endpoints for returning same model based on different fields?
What is the recommended convention to be followed for identifying different GET endpoints that fetch the same model/entity using different fields/parameters?
For example, there is a Student entity for ...
5
votes
2
answers
2k
views
Clean Architecture, how does the use case interactor generate different outputs?
I'm trying to understand how do controller and presenters work in clean architecture projects and could use some help. Specifically about generating multiple outputs from the use case.
In the Clean ...