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

learn more… | top users | synonyms

0
votes
1answer
26 views

Using “Id” as Primary Key in green field Dapper Contrib MVC 5 site

I am creating a new site and will base it on ASP.NET MVC 5 & Dapper Contrib. I want to go all in with all these technologies - and get all the time saving / convention over configuration / terse ...
-2
votes
0answers
26 views

I can not access $scope value from my controller within index.cshtml [on hold]

I am trying to create AngularJS, MVC ASP.Net single page application and I have stuck. I have created new folder within my project which contains app.js var myApp = angular.module('app', []); and ...
4
votes
1answer
77 views

Considerations for decoupling and refactoring business logic to a REST API

We've got a .NET Solution consisting of a MVC Website and a bunch of libraries for business and data logic. In the past the website was the only way to interact with our business logic, but we're ...
1
vote
1answer
361 views

JEE MVC, controller calls the interface instead of the interface implementation

I'm following this tutorial: http://wiki4.caucho.com/Building_a_simple_listing_in_JSP It creates a basic web application in Eclipse using the MVC pattern with Resin as the web container. Here's the ...
2
votes
2answers
530 views

How to efficiently handle related data in MVC?

Talking about MVC with servlets and JSP's, in a context about products and manufacturers , when querying the application for a list of products: the servlet loads a list of products from the ...
3
votes
1answer
88 views

Is there a good way to use the front controller pattern for command line applications?

I am a PHP developer and I used to build web applications with one PHP file per page for a very long time. This resulted in duplicated logic and messy code (even though I didn't know it at the time). ...
13
votes
8answers
21k views

Is there any design pattern except MVC for web?

I want to know are there any design patterns for web besides MVC? I know there are design patterns as: Registry, Observer, Factory, ActiveRecord ,... and MVC a set of other design patterns and folder ...
2
votes
2answers
38 views

Rails' MVC vs Microsoft MVC - where to put logics?

Some time ago I switched from Microsoft ASP.NET 2.0 (WebForms, never knew Microsoft's MVC) to Ruby on Rails and learned it's MVC approach, after which some things in ASP.NET MVC seem to be weird. In ...
3
votes
1answer
95 views

Increase code duplication to simplify business rules in views

I am in the process of writing a Ruby on Rails web application for my university's department. For some of our resources in the web application, e.g. Project, are complex with their view layer logic: ...
1
vote
1answer
64 views

In a .NET Windows Forms app with a custom MVC, should a custom UserControl (view) implement any non-animating logic on its own?

This is strongly linked to these two questions: http://stackoverflow.com/q/15800945/279112 Should Controller know about View & Model? or vice versa? as well as this one: ...
1
vote
1answer
105 views

How to compute Pricing of Product & Options based on User Option Selection and Pricing per Option

I am building a service for pricing options of a product and for pricing the product itself when product has various options. Example User selects some X options out of Y options available, where X ...
4
votes
2answers
155 views

PHP MVC/PAC - Logged In/Admin checks placement

I have set-up a MVC/PAC-like structure for a web application (unsure if it fits any of these design patterns fully). In short it is: Routing in index.php, which selects the controller and method ...
45
votes
14answers
19k views

Isn't MVC anti OOP?

The main idea behind OOP is to unify data and behavior in a single entity - the object. In procedural programming there is data and separately algorithms modifying the data. In the ...
1
vote
0answers
43 views

Project Design - Separating JS and C# tasks - Risks vs Benefits

I'm in RFP phase working with outsourcing vendors on the 100% rewrite of a fully operational prototype asp.net app that I wrote, to make it commercially viable. I have an idea for a project design ...
1
vote
1answer
151 views

iOS Best practice for handling model objects

There are different levels I'm asking this question at. Case 1: Let's think about the typical drill-down design. Say a table view controller has an array of custom objects, and tapping a cell will ...
-1
votes
2answers
89 views

What handles the work of video streaming in ASP.NET MVC?

I want to play video using ASP.NET MVC. In my understanding, the model deals with the video files stored in file system and data in database. The controller retrieves the path of video file from model ...
7
votes
2answers
154 views

Am I using Zend Form library correctly? (I am effectively duplicating work in Controller and in View)

Brief Summary This question is asking for guidance on how to deal with Zend Form library that allows me to specify how to construct each form element (Controller side) and how to render each element ...
32
votes
5answers
28k views

How to avoid big and clumsy UITableViewController on iOS?

I have a problem when implementing the MVC-pattern on iOS. I have searched the Internet but seems not to find any nice solution to this problem. Many UITableViewController implementations seems to ...
1
vote
0answers
37 views

Where does export file code belong in an MVC implementation that is designed mainly for HTML

I have an MVC website set up with a base view (Layout.php) containing HTML header and footer code. Other views (such as CarView.php) will extend this class. One of the methods in this class is ...
4
votes
3answers
4k views

What is the proper way to pass the parameters into a MVC system?

I am trying to learn java servlet/jsp with the MVC concept and built the simplest MVC application. Now I want give more detail to it to enhance my understanding. If I would need to register a new row ...
0
votes
3answers
62 views

Value of dependency injection in MVC with skinny controllers

Dependency injection is often recommended in MVC projects because it's easy to implement with the pattern and adds a host of potential benefits. Indeed, it actually comes bundled with the default MVC ...
3
votes
1answer
233 views

Help in writing more generic code

I'm doing a php MVC project using code igniter. I have two models, a and b. Each class contains four functions (insert, delete, update and view) and their implementations are almost the same with ...
3
votes
1answer
236 views

Do Rails Join Models Get Controllers?

I have a rails app where my users can buddy up with other users. Since that relationship can have a status (approved/rejected/pending), I decided to go with a join model (UserRelationship) so now I ...
0
votes
0answers
28 views

How to design MVC in JavaFX with respect to performance of the non-gui task

I'm working on a huge application and we got some serious troubles regarding the performance of the software. I don't want to bother you with too many details, so in short: in one JVM runs the GUI ...
1
vote
1answer
122 views

How to deal with states in front end?

This may sound as a naive question but its bugging me since a long time. I have the following scenario: I have written a new shiny Todo service with my favorite front-end and back-end framework. To ...
1
vote
1answer
134 views

Getting data from a database with the MVC model

I am creating an application which will have a very large database to draw it's information from (a student registration system to be exact). The database is created with Microsoft SQL Server if that ...
0
votes
0answers
17 views

Angular2: Do services exclusively handle getting/updating models?

I'm testing the waters of Angular 2 with an app that manages car dealer inventory. Suppose I have a simple model: export class Car { id: number; make: string; model: string; color: string; } ...
27
votes
10answers
6k views

Should a view and a model communicate or not?

According to the wikipedia page for the MVC architecture, the view is free to be notified by the model, and is also free to query the model about its current state. However, according to Paul ...
-1
votes
1answer
122 views

Code structure of third party framework [closed]

Is an API always returning 200 OK, an issue?
2
votes
2answers
225 views

Do common MVC frameworks violate the LSP and is there a MVC framework which does not?

You who have worked with a framework implementing the MVC architectural pattern most likely know how these frameworks are usually implemented. They contain a base Controller class, which you extend, ...
1
vote
2answers
132 views

MVC - Database search logic in View or Model

Special Note: I asked a very similar question on Stack Overflow, but I have since decided the problem should be solved from a design standpoint rather than an implementation standpoint. I have ...
1
vote
4answers
80 views

Advice: Switching to MVC from Webforms Web designer vs UI designer [closed]

Over the last two years, I've taken over a web application development group. My focus for the first two years was building teams, get technology updated and in-place, and fixing my customers pain ...
0
votes
1answer
60 views

Should models be returning data directly to the client, or to the controller instead?

Disclaimer: This is my first time: using node, creating a REST API, and trying out MVC server side. (so, just statistically speaking, I'm probably doing something wrong ¯\_(ツ)_/¯) I'm working on ...
-1
votes
2answers
89 views

MVC as a subset of client-server architecture?

Can we say that MVC is subsystem (or subset, sub-architecture) of client-server architecture?
7
votes
4answers
233 views

Encapsulation for complex queries

I tried asking this question first on StakOverflow in a more concrete manner, but after being pointed here I realized I should rephrase it in more general terms; however, you can still review the ...
0
votes
1answer
54 views

What would be the best technique for website localization in MVC?

Currently I'm working on a big website that will be published on almost 40 domains with different languages. My question is what would be the best way of doing localization/internationalization. I'm ...
3
votes
2answers
201 views

Using MVC style, where is the best place to put SQL functionality?

I am wondering about best practices here. MVC (Model - View - Controller) patterns involve separating components of your program that model the data, manipulate those models, and display those ...
6
votes
6answers
5k views

Programming PHP without MVC, classes or framework: rewrite or continue on new features?

I have been programming for several years now, and back then (learning PHP) I've didn't learn to program using classes, MVC-logic or using any frameworks. I found my self solving my problems very well ...
2
votes
2answers
419 views

What did the reviewer refer to in this code review?

I sent the code for a job application and got the following review: Regarding the Project Structure: Physical separation is absent. Logical separation is present but not up to best practices. Things ...
1
vote
5answers
8k views

asp.net mvc vs angular.js model binding

So I've noticed a trend lately of .net web developers using angular.js on the client side of applications and I've become more curious as I play around with angular and compare it to how I would do ...
1
vote
3answers
80 views

Should I keep “redirect only” methods in my Controller?

Controller: function indexAction() { if ($condition) $this->renumPosition($id); //LINE #1 } //Redirect only - function's sole purpose is to call another function function ...
-1
votes
1answer
26 views

Class that prepares strings from HTTP requests at PHP controller level

I have a library /Web/ such as follows /Web/ Builder/ Builder.php Exceptions/ ExceptionHandler.php JSONSerializer/ CategoryJSONSerializer.php ...
1
vote
1answer
122 views

MVC Architecture: How to generate a view-model that is displayed on every page

I have been building a greenfield application. It is three layer (data-access, domain-models, presentation) with the presentation layer being VMVC. This is the cleanest application I've ever built by ...
1
vote
3answers
1k views

Building a calculator using MVC

I've been programming in Java for about 6 months, and I thought a good and challenging test of my skills would be to build a GUI calculator. I have very recently heard about this MVC idea, and I ...
3
votes
3answers
89 views

Why do we separate Data Retrieval from View?

I am seeking a good argument for: Why is it NOT a good idea to embed data retrieval code in my view? Example <tr> <td>Product</td> <td><select name="product"> ...
-2
votes
2answers
174 views

Angular JS vs Modern MVC frameworks

I might be wrong for some things here, but here is what I recently though about. Modern frameworks MVC such as ASP.NET MVC 5, CakePHP, Java Spring etc. has their logic clearly separated into Models ...
2
votes
3answers
120 views

Is Model a better place to set HTTP status code?

In MVC usually the controller sets whatever needs to be sent back to the client/View, including HTTP status code, e.g.: class Controller { public function get(Request req, Response resp) { ...
3
votes
1answer
52 views

Logic and Values in View or Controller

I have an application built using an MVC framework (for argument's sake, PHP/Yii2) and have a question regarding where to carry out logic and generate values which will be injected into, for example, ...
4
votes
2answers
3k views

Is MVC the optimal pattern to build a RESTful web service?

Not being a Java practitioner, I recently came to learn about the JAX-RS specification and Apache CXF framework. While still wrapping my head around all these things, I also read the this question on ...
2
votes
2answers
106 views

Where to put User Interface/Domain Model manipulation logic (transferring data from the view to Domain Model)

We are starting on a greenfield project in ASP.NET MVC. I've used the MVC pattern in other stacks (PHP and Ruby) and I keep running into the same problems of where to place business logic, UI logic, ...