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
0answers
13 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
1answer
47 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 ...
0
votes
2answers
56 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 ...
0
votes
2answers
60 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
1answer
56 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
1answer
101 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
1answer
44 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
2answers
105 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
1answer
76 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
2answers
56 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 ...
1
vote
0answers
45 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 ...
1
vote
3answers
65 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 ...
1
vote
1answer
53 views

How does controller work with view in MVC?

http://geekswithblogs.net/dlussier/archive/2009/11/21/136454.aspx says MVC – Model View Controller Let’s look at MVC first. You’ll notice a few things about the diagram: The input ...
1
vote
1answer
60 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
0answers
21 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
1answer
89 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
1answer
197 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
1answer
56 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 ...
0
votes
0answers
108 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
1answer
28 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
2answers
76 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
0answers
19 views

django apps updating another apps model\data

I know django apps should be built to be more or less reusable and not tightly coupled with other apps... But I'm struggling to find best practices for having one app update data in another app ...
0
votes
1answer
50 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
1answer
67 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 ...
0
votes
1answer
34 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
1answer
141 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 ...
5
votes
4answers
511 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
2answers
119 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
2answers
368 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
2answers
459 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
1answer
123 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
1answer
73 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
1answer
159 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 ...
0
votes
2answers
210 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
3answers
492 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 ...
4
votes
4answers
447 views

Refactoring ASP.NET Web Forms App to use MVP vs incrementally rebuilding it using MVC?

My team has inherited a Web Forms application that was built over the past decade or so into a monolithic code base with massive dependencies. In order to maintain this system we are going to have to ...
1
vote
4answers
792 views

Do we need Models if we are using ViewModels?

Why do we need Models when we could: Only get the data (which is to be displayed) Populate the ViewModel with this data Pass this ViewModel into the View
1
vote
1answer
83 views

Data is in database or get from API, where should API request code goes?

For me, the data I want to retrieve may be in database for which I can use properties of model and also relationships, but if the record is not a property and no relationship exists for that ...
1
vote
1answer
151 views

Building a MVC Framework: Should I get an instance of Database, or should I extend with a “general” model class that already has an instance of DB

I am trying to get a database instance via any model-class that uses the database. This is ideal in my opinion: class UserAuthenticator { private $db; private $customer; public ...
1
vote
1answer
51 views

How to inform presenters of sub views of a main window about global data change in an MVC or MVP GUI app?

Suppose I'am writting a GUI desktop application which has a main window with a corresponding presenter. This main windows may host one or multiple panels which each also have their own presenter. The ...
0
votes
0answers
54 views

Messaging engine architecture with front-end and ORM layer (spring)

I'm looking to push my first QuickFixJ messaging engine into production, and I would like to know the best way to do so. Bear with me. The gist of the responsibilities is as follows: Through ...
0
votes
0answers
36 views

Provide user access on credit card transaction

I have a database where users have access to a model (called institution), which is designated to them by the admin. In Node.js (using strapi which is a headless cms) I wrote the logic to restrict ...
-2
votes
1answer
17 views

Migration Of Demo Version Projects to Live Version in .Net MVC Applications

I have an application which is currently used by clients. So based on the feedback from the client, normally we are fixing bugs in a live application.Parallel I am adding new modules to demo projects....
-2
votes
1answer
197 views

PHP MVC - which approach is the right one

Next semester we'll learn the mvc pattern in web development but since it looks pretty interesting to me i decided to learn it now but...there is a problem. Surfing trough the pages i found two ...
1
vote
0answers
134 views

Refactor MVC to more scalable architecture?

Months ago I began a new web project which, in the beggining, seemed like a small application with virtually few users. I began the project by using the awesome Hackathon Starter WebApp Boilerplate by ...
0
votes
0answers
269 views

Running multiple MVC projects: One site

I am developing a "platform", I have an MVC site that will hold all the main data, as well as our generic API, uses Microsoft authentication to create an account, then our employee MVC will add the ...
2
votes
3answers
302 views

Reconciling MVC with a strategy pattern

I am working on a Rails application which employs a classic MVC as its fundamental structure. In that structure the controller is supposed to be responsible for "which view to render when". Now after ...
2
votes
1answer
434 views

In MVC + SOA Architecture, What is the Rationale for Placing Business Logic in Models?

When writing web applications I place business logic in controllers. This has worked well for my small App Dev team- our applications run reliably, perform well, and the code is easy to maintain. ...
0
votes
1answer
68 views

Modeling entities for company invoice management software

I am making a software to store all my company invoices (and then infer some statistics about it). The idea is: My company issues invoices to it's clients. My company receive invoices from it's ...
1
vote
1answer
178 views

Is this a valid site architecture?

We have a legacy site that was written a while back using MVC. It's a valid MVC for the most part except for the Data Access Layer. The site has Models, Views, and Controllers. However, instead of ...