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 [mvc]

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

0
votes
2answers
68 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
104 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
0answers
35 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
51 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
65 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(); ...
0
votes
0answers
35 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
0answers
24 views

Can MVC be utilized via foreign function interface?

As far as I understood, MVC has the biggest advantage in creating a separation of concern and making three components decoupled as much as possible. All of the examples I saw were in a single ...
0
votes
2answers
171 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
412 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
230 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 ...
0
votes
4answers
219 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
73 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
148 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
43 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
33 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
34 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
102 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
87 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
69 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
171 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 ...
0
votes
1answer
222 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
57 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
163 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 ...
1
vote
2answers
65 views

Thin Controller: Make a Controller Service wrap other Services?

Say you have a HomepageController that' suppose to show all the blogs, users, gallery, and some members-only info (for logged-in users) Normally, it looks like this: <?php class ...
0
votes
0answers
64 views

For a responsive app, do frequent conditionals checking device size indicate a code smell or antipattern?

I have joined a team working on a large and mature responsive website (using a javascript MVC framework), and one thing I frequently see in the codebase is branching code in controllers or components ...
-1
votes
1answer
152 views

What software pattern is one where I simply assemble things, such as create an array of certain type of data?

TL;DR: what do I call a section of code that is used to assemble a Graph object? I have a fairly large section of code that is duplicated in a few areas. I wish to extract it into its own class. ...
3
votes
1answer
227 views

Propagating Data to multiple ViewModels - C#

I'm a bit new to MVVM, but here's my dilemma: I have a model (or models, but let's keep it simple) I want to show that model data on multiple different views. Ok, so ViewModel for each view gets ...
0
votes
1answer
51 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 ...
2
votes
2answers
632 views

Difference between MVC and ECS

Following reading Thomas Owens response (many thanks to him) on Is it reasonable to build applications (not games) using a component-entity-system architecture? and his explanation on what is ECS ...
0
votes
2answers
81 views

Is it a good idea to let database surrogate key values spill out into other aspects of code (HTML, Controllers, Model, Repository layer)?

Is it acceptable to use id in HTML forms and subsequent code processing (controller, view, model, repository layers)? For example I need to show something like this on a web page: Select Motor ...
0
votes
0answers
28 views

JSON in relational DB column for 'custom' data - how to present it on web page

I am creating a generic telemetry system, which records some data about client app usages. Technology used: ASP .NET MVC with EF (code-first) hosted on Azure. There is a requirement to be able to ...
2
votes
2answers
196 views

What is the correct usage of the IEnumerable interface in C# to deal with collections?

When I am working in ASP.Net MVC or WebApi, I often find myself creating Views or return data structures that include 'List<>'s of objects. Meaning that I have a list of data objects that I want to ...
2
votes
0answers
194 views

N-Tier/Layered Architecture with MVC

Do N-Tier/Layered architecture really helpful with MVC? I have some projects here that use N-Tier architecture with MVC. The available layers are Entity Layer Data Layer Business Layer Presentation ...
1
vote
1answer
44 views

What is the best way to implement model property authorization in an ASP MVC?

We have an MVC application that has very granular and configurable authorization. We currently have been using the authorize attribute against our controllers and controller functions. The next ...
0
votes
1answer
94 views

Should I “Connect->To controller A”, or “To controller A->Connect”?

For example, suppose I have a shopping app, which has a user info page to show user info: class UserInfoController{ toPurchaseRecord(){ } } and a purchase record page to show purchase record,...
1
vote
0answers
376 views

Handling complex dynamic queries in Laravel 5

I am developing a project using Laravel. My workflow is: route directs to controller Controller calls eloquent models Eloquent models perform queries (tipically CRUD and find) Controller returns ...
3
votes
1answer
125 views

Future/Promise objects in Controllers - Best practice - MVC [closed]

I was going through some articles related to Futures and Callables today and was thinking about the best practices when working in an MVC based environment. I was wondering, should one be creating ...
2
votes
1answer
121 views

Abstraction for Account transactions and balance

We have 10 applications which updates account balance table, without logging credit/debit line transactions (not sure why). They all have the pretty much same SQL Statement. In order to get out of ...
0
votes
1answer
63 views

C# Separate Online Store into Different Solutions and Nugets

I am creating an Online Shopping Cart store. It is built through Net MVC Core. There is a Front End View website: html, css, razor. Then we have backend code design for Customers: including shopping ...
1
vote
1answer
667 views

Architecture / Design Pattern for Login Signup

I have a multi-seller ecommerce platform, derived out of Opencart 2.3. We changed quite a bit of the core code of the Opencart to add our own customizations, including features such as Seller ...
1
vote
1answer
70 views

Using a JWT for a web service after logging in (login twice?)

Good day everybody, My capstone project partners are stumped with a logic question that has to do with JWT, MVC & web services. We have already built a web app with a signup/signin feature using ...
-3
votes
1answer
130 views

What things to refactor first [duplicate]

I do understand this is a wild question and totally open-ended but just wanted to know that I am barking up the right tree. I've inherited a large code base of many solutions and services, and whilst ...
2
votes
6answers
559 views

Models: two very different concepts

There are a lot of questions and answers about what a/the model is. Particularly when discussing where business logic belongs and the MVC pattern. There seem to be two concepts that need to be severed....
1
vote
2answers
74 views

Should model/view in MVC be concrete or generic?

In the MVC pattern, should model and view be very concrete and tailored to the represented component? Or should they be as generic as possible so that they can easily be reused? Specific case My ...
1
vote
0answers
240 views

MVC - How should components inside controller communicate?

I'm developing a level editor in Java. I'm designing its code in MVC. From what I've learned: controllers can have a direct reference (fields) to views and models. Views can have direct reference to ...
1
vote
1answer
135 views

MVC: How to use data model list in recursive views

I am trying to learn web app MVC in PHP.Most of the articles discussed about 1-to-1 MVC pattern given bellow Controller: gets user request & update model, Model: receives orders form Controller &...
0
votes
1answer
835 views

PHP MVC controllers using ajax

I'm learning to use the MVC pattern to design my PHP's software. I always use ajax to send requests to my controllers so often I've a code structure like this: <?php if(isset($_POST['action']) &...
0
votes
1answer
42 views

A separate UIViewController for UITextField - iOS

In my iOS project I have a set of custom textfields, e.g. for password entry. As an example, such textfields can contain additional views and logic - for example, show or hide a password with a press ...
0
votes
0answers
54 views

how to structure symfony's code in case of lack of models

I have the following scenario: I'm developing a CRM in symfony which takes advantage of microservices to gather and manage information. Basically what it does is presenting information coming from the ...