Questions tagged [mvc]
MVC (Model-View-Controller) is a software architecture pattern that enforces separation of concerns.
935
questions
0
votes
1
answer
71
views
MVC (templates): is it OK to call functions with arguments from the View?
In a MVC scenario, is it OK to pass arguments to functions from the View to satisfy different formatting needs?
For example: let's say that the model has a DateTime object and the view must show this ...
1
vote
0
answers
81
views
Am I structuring this correctly for a .net mvc web app based on onion architecture?
]1
I am new to MVC. Most of my career I have used Web Forms in Asp.net. Reading about MVC has been really confusing because from what I have learnt is that in Traditional MVC, models were supposed to ...
1
vote
0
answers
105
views
Paginate large data and store in temporary table for navigation
I have implemented pagination using SQL and stored that result of search into temporary table.
Temporary table is named after unique tab id.
So that other tab can have seperate result sets.
That ...
4
votes
0
answers
649
views
Identity and access management in Clean Architecture and MVC design
The application user has a lot of standard functionality we see in most applications. At a high-level, this includes some form of authentication, authorization, and session management. At a low-level, ...
1
vote
3
answers
129
views
Should the View pass data inserted from user to Controller or should the Controller get data from View's fields? (MVC Pattern)
My View has a textfield and a button. According to MVC pattern on button click should be called a function of the controller. This function should do some operation on the View's textfield content. It ...
-1
votes
1
answer
45
views
Using MVC with multi-table data
I read a few articles and Stack posts but I'm still unsure how to use MVC properly.
One of my app features is handling meetings - each having a list of subjects to discuss. My database tables look ...
2
votes
1
answer
95
views
How to properly model an MVC model in this case?
I aim to understand pull model MVC. I'm stuck at defining a model for a simple color-guessing game in Java Swing I chose to practice it.
I borrowed the model's initial version from an example which ...
2
votes
1
answer
84
views
Separating Plotting and Computation Logic in Scientific Computing MVC App
I’m developing a Matlab GUI for a scientific computing application and need to plot fairly heavy intermediate results.
Currently, the computation is represented as a function. The GUI accepts user ...
-1
votes
1
answer
92
views
Need some criticism for my backend app Architecture
I have been learning Backend development for quite a while now and I decided to build a bigger project using Express.js and the MVC architecture, the project is basically a Restful API with Vue.js in ...
0
votes
1
answer
5k
views
Is it okay to have one Service with two different Repositories in Spring Boot MVC?
I have a backend Spring Boot API that should have one(?) endpoint that returns some statistics to display in a frontend. These statistics are calculated from data that comes from two different ...
0
votes
1
answer
2k
views
Is it good practice to save an entire ViewModel in Session (C# ASP.NET MVC)
I have an C# MVC Application which is basically a large application form. We are using a large ViewModel to store all the information the user enters as they pass through multiple steps in the ...
-1
votes
1
answer
159
views
Display different panel on button click (MVC pattern)
I have to code a gui like this:
It's an homepage with a left menu and a changing right part, on button1 click form1 must be displayed, on button2 click form2 a so on.
Each form has its own button "ok"...
1
vote
0
answers
19
views
Best RoR pattern for special instances of a subclass
I'm trying to figure out the best way to "partially" use the validates_uniqueness_of validator for a particular case of problem.
Let's say I have a Book class with multiple comments, with the Comment ...
-3
votes
3
answers
134
views
What are some of the best ways to create single page websites with dynamic content?
I'm expirementing with creating a website as a IT Ticketing system. This website has a top nav and a side nav. I want the content area to change depending on the link clicked. I've managed to get the ...
0
votes
2
answers
396
views
Model View Controller: Can the Model access the view directly?
According to my understanding, in the MVC design the Model can only receive the functions calls from the Controller and not from the View directly.
Is it true that the Model can change or access the ...
0
votes
2
answers
790
views
Model View Controller pattern for a Java desktop application
I'm struggling to fully understand MVC pattern, I found a lot of information on the web but they are really confusing because it seems there are various ways to do it.
What I understood is that the ...
2
votes
1
answer
419
views
Should I put add() method in Laravel model
It's my first post here as I understand that SO is a platform to find fixes and this is where to ask questions about more general questions. Correct me if I'm wrong
I'm working on project in Laravel ...
0
votes
1
answer
72
views
MVC database connection .NET
Introduction
I intend to create a .NET WinForms application (this will be a toy application) which connects to a SQL Server database backend. I have designed and implemented an object-oriented model ...
-1
votes
2
answers
1k
views
Needs to understand the difference between boundary, controller, logical class types
As the title implies I am trying to understand the difference between boundary, controller and logical class types, which are used in the MVC pattern.
I will do so using an example. Please consider ...
1
vote
2
answers
2k
views
Why and how are Server-side Web MVC and client-side/desktop MVC not the same?
In MVC, does the view component deliver a new view to the user directly or indirectly via the controller component? says
The first thing to realize is that Server-side Web MVC (e.g. ASP.NET MVC &...
-1
votes
1
answer
151
views
How shall I implement a MVC program into presentation, business logic and data access layers?
Here is part of an ASP.NET MVC program, from https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/controller-methods-views?view=aspnetcore-3.1 :
A model class Movie:
public class ...
3
votes
1
answer
265
views
What domain objects might I need to represent a user and users profile in a forum web application
I’ve been trying to get a firm understanding of the MVC design pattern so that I can write my own framework for implementing the back-end of a forum web application using Slim 3. In particular, after ...
1
vote
1
answer
50
views
Web/network Architecture with loading indicators
Let's say I'm using a MVC pattern. Here's some pseudocode:
View {
main() {
Controller.callAPI(url);
display(item, position) {
// display item at position
}
}...
1
vote
2
answers
234
views
Is MVC an architectural pattern for user-interactive applications only?
Is it correct that MVC is an architectural pattern only for user-interactive applications? (That is my understanding.)
An application can interact with users via GUI or CLI.
Does MVC apply to both ...
1
vote
1
answer
153
views
Controller class for an input dialog
I am learning OOP, concretely Java, by developing a real life business application for aimed for repair shops. I have followed MVC pattern design for GUI elements of my application. I was wondering do ...
0
votes
2
answers
183
views
Preventing double submissions using PRG pattern
You probably know PRG (Post/Redirect/Get) pattern used in web applications to avoid double form submission (and usually conseguent item duplication in a data store).
But I keep reading this is not a ...
2
votes
0
answers
60
views
Do MV* architectural patterns apply not only to OO languages but also functional languages?
I am learning about MV* architectural patterns, thanks to the help from several answers here. I learned that they are used for designing the architectures of user interactive applications.
I also ...
2
votes
3
answers
302
views
In MVC, does the view component deliver a new view to the user directly or indirectly via the controller component?
In MVC, the view component doesn't receive user input directly, but the controller component does.
When the view component creates a view, does the view component deliver the view to the user ...
2
votes
1
answer
450
views
How does controller work with view in MVC?
Link says
MVC – Model View Controller
Let’s look at MVC first. You’ll notice a few things about the diagram:
The input is directed at the Controller first, not the view. That
input might be coming ...
2
votes
1
answer
976
views
Why does the Django Rest Framework encourage separating Model, Serializer and Views for the same object across multiple files?
Summary: Why shouldn't I put model, serializer and view classes for the same object in the same file in my Django Rest Framework application?
I'm building an application using the Django Rest ...
0
votes
0
answers
38
views
Template engine design question?
I don't know if this is the proper forum for the question as any answers will be rather subjective. But here it goes, please advise if there is a better place to ask this.
I am designing a small ...
-2
votes
1
answer
91
views
How Interfaces Will Help in Real time Scenario? [closed]
I'm working in a real-time project. They are using 3 tier architecture using interfaces but I am not getting how it will work as Dependency injection.
I know interfaces can be multiply-inherited and ...
2
votes
1
answer
666
views
How the MVC increase code testability?
I am learning MVC design pattern as an android developer and I've been seeing that it facilitates the testability of code. I understood this concept, but in real case I'm frustrated.
Can someone ...
1
vote
1
answer
460
views
Model-view-controller architecture, desktop application and database connection
Let's assume we have a class structure for a particular application (a University manager for example, with classes representing semesters, subjects, timetables and so forth). It is to be a desktop ...
1
vote
0
answers
537
views
How to design a PyQt/Pyside2 application to use the MVC pattern with the Qt MV pattern?
The context: I created a PySide2 app to remote control a pyhsical product. The device is interfaced with a driver to get and set it's overall state (state machine with nested and parallel states) and ...
-4
votes
1
answer
32
views
extending an MVC site to support a new controller, via adding a v2 area <- good idea? need help with routing
I want to extend our api to a (better) v2 version.
I came up with the plan of adding a "v2" area and under that, cloning each controller into it. (basically v1 sometimes returns json, sometimes text, ...
1
vote
2
answers
106
views
Class property re-use vs redundancy
TL;DR - When designing classes for MVC use, is there "best practice" for how classes should be structured to eliminate property duplication and/or redundancy? I'm trying to avoid large (one-size-fits-...
0
votes
1
answer
86
views
To And From Date Validation in Model
In my Springboot project I need to perform a validation of the type validFromDate<validToDate.
I was wondering whether would it be a good or bad practice to place a validation in the model itself (...
1
vote
1
answer
314
views
Model - View - Controller: Are input fields views or controllers?
I am having a hard time trying to understand the MVC pattern, in particular the role of input fields in this pattern.
1. Conceptual question.
Let's say I have a document as model and a text area ...
1
vote
1
answer
43
views
MVP where to set Content-type header?
I'm having some problems with deciding where to set the content-type header in a vanilla mvc framework. Should i add it inside the controllers method:
class ApiController extends Controller{
...
0
votes
1
answer
466
views
Are resource files (.resx) secure?
I have a resource file called AppSecrets.resx, and the bit of code below to check the login credentials of the "super duper admin user". This admin user is distinct from normal admin users, as it is ...
6
votes
5
answers
2k
views
Is it valid to let view models populate their own lists for dropdowns in mvc?
I've struggled to find any discussion on this.
If you have a simple MVC page for updating a User, and you put a dropdown list on it of Country, you need to populate the dropdown list in the viewmodel....
1
vote
2
answers
380
views
What are the relations between the presentation/application/data logics, client and server, and MVC?
I appreciate if someone could clarify my confusions about the following quote from Distributed Systems, by Coulouris et al:
Consider the functional decomposition of a given application, as
...
0
votes
2
answers
2k
views
How to avoid duplicate code in two similar MVC controllers
I have two panels, one for the admins and the other for partners. And there are two OrderController with Admin\OrderController and Partner\OrderController namespaces.
They both look very similar. ...
0
votes
2
answers
1k
views
PHP MVC - One view class for all controllers vs a view class for each controller
I am creating an MVC inspired PHP framework, mainly for learning purposes. I basically have the framework created and am building an app on it and improving the framework as i go along.
I am still ...
0
votes
1
answer
532
views
Manage table relationships in Java dynamic web application that accesses a database, without using any framework
I'm developing a web application for academic purposes.
What i have to do is a simple website which keeps track of realties along with their respective owners and the tags they are bound to.
The ...
0
votes
1
answer
136
views
Which types of objects that are instantiated inside controller's methods should be injected into the controller instead?
Consider code below
MyController //MyAction //MyHandler
{
public function processRequest()
{
// ...
$myObject = new MyObjectClass();
$myObject->methodCall();
...
1
vote
1
answer
547
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 ...
1
vote
2
answers
651
views
Does "Model" in MVC refer to the class or the instance?
Working on a Rails project at the moment, we're working on some mixin-type methods to provide descriptions for each of the models in the project.
There's a method called model_description which ...
4
votes
3
answers
959
views
Authorization and Audit on models in MVC architecture
What are the best practices to extend Authorization to the Model layer if in a monolith MVC application (i.e rails) you have other entry-points than just the Controller? I.e background jobs, or the ...