Questions tagged [mvc]

MVC (Model-View-Controller) is a software architecture pattern that enforces separation of concerns.

Filter by
Sorted by
Tagged with
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 ...
user avatar
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 ...
user avatar
  • 615
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 ...
user avatar
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, ...
user avatar
  • 181
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 ...
user avatar
-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 ...
user avatar
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 ...
user avatar
  • 429
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 ...
user avatar
-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 ...
user avatar
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 ...
user avatar
  • 109
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 ...
user avatar
-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"...
user avatar
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 ...
user avatar
  • 19
-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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
  • 236
-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 ...
user avatar
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 &...
user avatar
  • 5,301
-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 ...
user avatar
  • 5,301
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 ...
user avatar
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 } }...
user avatar
  • 113
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 ...
user avatar
  • 5,301
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 ...
user avatar
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 ...
user avatar
  • 199
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 ...
user avatar
  • 5,301
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 ...
user avatar
  • 5,301
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 ...
user avatar
  • 5,301
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 ...
user avatar
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 ...
user avatar
-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 ...
user avatar
  • 17
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 ...
user avatar
  • 131
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 ...
user avatar
  • 236
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 ...
user avatar
  • 111
-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, ...
user avatar
  • 191
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-...
user avatar
  • 117
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 (...
user avatar
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 ...
user avatar
  • 21
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{ ...
user avatar
  • 135
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 ...
user avatar
  • 131
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....
user avatar
  • 2,987
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 ...
user avatar
  • 5,301
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. ...
user avatar
  • 11
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 ...
user avatar
  • 1
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 ...
user avatar
  • 309
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(); ...
user avatar
  • 8,029
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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
  • 222

1
2
3 4 5
19