Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

0
votes
0answers
68 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
38 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
114 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
251 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
65 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
72 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
votes
0answers
21 views

MVC: How to pass latest data from model layer to view layer that maintains the data Consistency

I am learning MVC web apps in PHP.I want pass only model data to the view that can maintain the data Consistency.So every times the model updates its data, then it also updates the data in view. Here ...
1
vote
1answer
59 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
44 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
0answers
9 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
20 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 ...
1
vote
4answers
193 views

How to organize code based on functionality

I use MVC + service classes in my project. My projects structure looks like this: -MySolution.Web -MySolution.Models -MySolution.Services -MySolution.Common MySolution.Web is an asp.net web ...
3
votes
2answers
64 views

Where do I encode value conversion methods in an MVC web app to display values in different unit systems in the View?

I have a use case where I do internal data computations using English system, due to various precomputed graph coefficients and other data already using the English system. But for output I need to ...
0
votes
0answers
54 views

Does putting javascript in my JSP file make it impossible to test?

The project I'm working on has lots of JSP files, some of which have javascript script blocks scattered throughout and some of these scripts interact with other javascript packages that are served ...
2
votes
0answers
71 views

Creating bindable input handler in C++ spanning two separate modules

I have a wxWidgets application. This is the first, main module. The second module is an openGL engine. It's a model-view-(controller) structure, where application is the view (and the controller), ...
1
vote
2answers
27 views

Should I move my pricing service and creation of entity into the `SaveLineItem` service?

This is an MVC design/refactoring question. I am using a Controller and inside I do these tasks: I get Price of an object from a database, for which I use a repository pattern Create a LineItem ...
0
votes
2answers
52 views

Is RenderAction compatible with MVC architecture?

So I just came across an extension method built into ASP.NET MVC: ChildActionExtensions.RenderAction(...). This invokes an action method using the given parameters and renders the result inline in ...
1
vote
0answers
38 views

PHP MVC - Single action for multiple similar views or one action for each?

For example, if I have 3 database tables that have similar columns/attributes: cats, dogs, bunnies Each table has a view that consists of an html table listing all records in the table, and a form ...
0
votes
0answers
29 views

Where to keep the code for new instance of an object in iOS project?

Example: There is a KingDetailViewController class with the following code. // MARK: - New Instance extension KingDetailViewController { class func newInstance() -> ...
1
vote
3answers
109 views

Is it bad practice to build a large web component as a Html Helper?

So, from my understanding, Html Helpers are supposed to be for single elements or small snippets of html. However, I'm not really sure why I think this, or how I came to abide by the practice. I ...
-3
votes
2answers
653 views

Is it better choice to use both AngularJS and ASP.Net MVC for developing ecommerce website?

I know about MVC, But I don't have such experience with AngularJS. But both has controller and View. To develope like e-commerce site, is it good choice to choose AngularJS to do filtering with ...
-1
votes
1answer
148 views

Should a graphical user interface implement Propertychangelistener or it's objects?

I was learning about design patterns and i came across a line where a domain object has to update it's view using observer design pattern. In the book , Applying UML and design pattern, It says Let ...
1
vote
1answer
92 views

Are signals/events the only way to modify one view from another?

I need to set a mode in one view from a different view. Trying to stay organized with MVC. Looking at answer at Invoke model logic in one UserControl from view-model in another UserControl without ...
0
votes
0answers
44 views

Adding Business Logic into typical MVC + EF structure

We are writing a .net Core MVC Web application, but I think this is a general programming question. This is typically the structure we use with our .net Core MVC Web applications, using dependency ...
0
votes
1answer
272 views

Is it possible to add Service layer in MVC pattern?

I'm working on javaFX project using Hibernate and H2 database,I'm trying follow the concept of MVC design pattern ,so I have created 3 packages : models :contains POJO classes 2.1 views.fxml:...
2
votes
1answer
69 views

ASP.Net MVC When ViewModel properties vs Ajax calls in view

When is it more appropriate to use asynchronous calls from the view to get data vs prepopulating it server-side when creating the instance of the viewmodel? For instance, if my view has some dropdown ...
1
vote
1answer
146 views

Data layer Abstraction from Business layer for search

This is regarding designing a search api. We have 3 tier architecture now using Spring MVC. All communications are via REST api. UI <-> Business <-> Data(sql). Now to implement faster ...
1
vote
1answer
114 views

MVC with PyQt - How to reduce data queries by the View from Model?

I'm currently developing a Python program with a GUI based on Qt 5. I use a MVC template I found on Github. Let's assume that a single check box was checked or unchecked and the model was updated. ...
0
votes
1answer
252 views

JavaFx : Is there difference between String and StringProperty in Model Classes?

I'm trying to follow MVC concepts when i develop my application ,but I'm confused between Using String or StringProperty in Model classes. Example one : public class User{ String name; ...
1
vote
1answer
52 views

Should the Service interface not extend the DAO?

I'm writing the service layer for my DAO and I've made it extend the DAO interface. It looks a bit like this: public interface FooDAO { Foo get(long id); boolean update(Foo foo); These two ...
3
votes
1answer
265 views

Data sync between Model and View in MVC pattern

I have a question about MVC pattern, concerning the controller part. Most of the program I happen to write are basically spreadsheet like. They are written in C/GTK+ and Python3/Qt5/Tkinter but share ...
0
votes
0answers
79 views

MVC and ashx files

We have a single page app which creates all Gui with JavaScript/css. No server side generated gui from aspx files etc. the JavaScript typically loads json data from the server using xmlhttprequest ...
1
vote
1answer
111 views

What alternative name to give to controllers?

There are several posts and other contents in the internet that claims against naming classes ending with "er" (like manager, controller, helper...). I personally agree with that, but what ...
0
votes
1answer
85 views

Anonymous Controller/Action within Authorized Site

Say I have an MVC .net core website where 100% of the controllers/methods are behind [Authorize] attributes (complete with policies and all). Would it be taboo, to carve out a set of un-authorized/...
-1
votes
2answers
223 views

What is data persistence in the context of software engineering?

I imagine it is simply, as it is named, the existence of data throughout layers of a software application. I ask because I have not been able to find a clear definition that states something of the ...
2
votes
1answer
403 views

How to update the view when the model changes?

Since I'm learning the MVC pattern, this might be a very naive question. I know that when something happens on the view (e.g. user clicks a button), the view calls the controller which in turn ...
3
votes
3answers
959 views

Should I always use the MVC pattern (or similar) for big, graphical and professional applications?

If I write an application and decide to develop only a single graphical interface for it, and never intend to develop multiple GUIs, then by today's standards it is okay not to use the MVC pattern or ...
-1
votes
1answer
80 views

Should we implement the state machine logic near the data in the “persistence” layer, or bring the data out and implement it in the “listener” layer?

The implementation is MVC. The View is isolated to the browser layer. The Model is isolated to the persistence layer. The Controller is split with: UI controls in the browser mostly so input is ...
0
votes
0answers
124 views

How to approach designing a system where UI consists GUI and hardware interface?

I have developed software for kiosk that sells a single product. Users can interact with it via GUI (web browser) and hardware interface (cash and card payment systems + receipt printer). Looking ...
3
votes
1answer
142 views

Is a high atomicity in mvc overkill?

As time passed by I learned that not strictly following the rules of a architectural pattern like mvc kind of counteracts the actual purpose of having a maintable software. Usually I end up with fat ...
0
votes
1answer
71 views

Where should I generate response for api?

I have multiple Models(Models in MVC), These models are injected into repositories and repositories are injected into Controllers. I need to create an api for several endpoints. The responses for ...
0
votes
1answer
52 views

MVC: Better Use Custom Getter or Repository Function

I am using PHP with Symfony and Doctrine but my question should be independent from any used language or framework. Suppose you have an entity Product with a One-To-Many relationship to another ...
7
votes
2answers
1k views

Proper design to avoid the use of dynamic_cast?

After doing some researches I can not seem to find a simple example resolving a problem I encounter often. Let's say I want to create a little application where I can create Squares, Circles, and ...
1
vote
2answers
106 views

Bundling Model and Services in MVC pattern?

These days, all I hear is how MVC should contain additional layer called services, turning it into SMVC. But to me, it seems like too much of a decoupling and instead want to engineer my app something ...
0
votes
0answers
44 views

Creating a “clean code” NodeJs Model with additional Ajax Calls

I already asked this here https://stackoverflow.com/questions/47991416/creating-a-nodejs-model-with-additional-ajax-calls but maybe this is not a coding problem. I have a design pattern question. I ...
-2
votes
1answer
110 views

Java MVC or Rest based approach with security [closed]

I am working in designing Java-based web applications. Although, I have worked with Java core still a novice in designing web-apps and do not have enough confidence in what I am thinking is correct or ...
4
votes
0answers
212 views

Handling common code among presenters

I'm facing some issues related to code duplication when following MVP architectural pattern in an Android project that I'm working with. My project structure is separated by packages: data, domain, ...
3
votes
1answer
103 views

Should the presenter access view data via properties or event parameters?

I have a new-employee form. When the "Save" button is pressed, a SavingRequested event is raised. The Presenter gets an Employee object from the View and passes it to the Model for further processing....
0
votes
2answers
127 views

Is it acceptable to break MVC by storing data in the DOM in order to reduce load on the Database Server, ever?

I am currently using NodeJS & Express to load webpages which contain element content that is rendered via a query to MongoDB. A GET request will create Button elements, binding the MongoDB _id ...
4
votes
1answer
117 views

Should a Controller have a Model object as an attribute?

For context, this project is a personal budget program I am working on while I try to learn to use MVC patterns effectively. There is a SessionController that passes user commands to a ...