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

Questions tagged [mvc]

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

0
votes
1answer
81 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
42 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 ...
-2
votes
0answers
38 views

How to maintain a web application for different clients with different UI and several customized functions?

We have an web application that mvc architecture and written in php. This application is used by different client that need different UI and also several module customization. This application is ...
1
vote
1answer
138 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
50 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
63 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
151 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. ...
2
votes
0answers
57 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
45 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
164 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
70 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
23 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
189 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
50 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
32 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
32 views

If I need connection to get data, then display the data at controller A, 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
153 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 ...
0
votes
1answer
33 views

ViewConfig inheritence hierarchy for views

I need some help with the hierarchy of view configs, which populate my views (templates). Maybe view config is not the correct term here, it's just the one I'm using, maybe view state makes more sense?...
3
votes
1answer
89 views

Future/Promise objects in Controllers - Best practice - MVC

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
52 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 ...
-1
votes
1answer
50 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 ...
0
votes
1answer
160 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
40 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
121 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
331 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
70 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
99 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
79 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
334 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
24 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
38 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
217 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
73 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
56 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
76 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
28 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
53 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
41 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
34 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
132 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
972 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
150 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
98 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
55 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
436 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
160 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
212 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
213 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. ...
1
vote
1answer
506 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
69 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 ...