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

learn more… | top users | synonyms

-2
votes
0answers
47 views

How does one create a PHP page router controller?

I am making a PHP controller that should route pages on my website. It is my first attempt. Can someone revise this code and tell me if this makes sense or not. (never mind the logs array, I use it as ...
2
votes
1answer
39 views

Where should view-specific data/logic be defined in a PHP MVC application?

After many hours of research and thinking I have found an understanding, then coming to question it again, I am struggling to find something concrete which I can grasp and apply to my code in a ...
1
vote
2answers
163 views

where to put which code in MVC model

I recently picked up learning PHP and MySQL and I am trying to build a small usersystem as a coding exercise. While learning to use classes and functions, I also stumbled upon the MVC model and would ...
0
votes
1answer
34 views

Should we sanitise and clean data or only display it in the expected format?

So my problem is, I have users entering their data(names, address) in a mixed form- some with first letter in caps and some without, some inserting more than necessary spaces and so forth. Also, ...
0
votes
0answers
59 views

Should Rails views actually render anything?

I've joined a Rails app with hundreds of pages and no tests, first thing I've done is set us up with model-, controller- and feature-tests and I'm adding them as I work on areas. One thing I'm ...
0
votes
2answers
47 views

How does two-way data binding differ from simple auto-sync?

The AngularJS documentation mentions that it considers one-way data binding to be 'bad' and two-way data bind to be 'good*'. However, on looking over the definitions of two-way data binding used, all ...
-2
votes
1answer
81 views

How to incoporate jQuery UI into ASP.NET MVC 5 project that is on an offline system? [closed]

I am having some issues trying to incorporate jQuery UI into my project. I cannot use Nuget or anything else that goes to the internet, so I have downloaded the development package from the jQuery UI ...
4
votes
1answer
62 views

MVC: Display requsted content via the View

I'm trying to learn how the MVC pattern works so have been playing around a bit. I just wrote this, which was making sense to me, until I wanted to display the array content which has been collect by ...
4
votes
1answer
43 views

How to prevent endles event recursion when using event driven data view?

Consider that you have some graphical interface that represents some data structure. For example a text field: This field is connected to the data structure through events. I tried to make diagram ...
0
votes
1answer
35 views

MVC design in Cocoa games: Is it possible?

I'm working on creating games on OS X, using the Cocoa framework, the probably only and best way to utilize all the capabilities of this operating system. Since Cocoa is MVC, I have to frame my games ...
1
vote
1answer
51 views

Accessing i18n objects from different scopes

I have been building a personal framework of mine which started off as a way to learn the MVC pattern and has progressed now into something that I like more than most frameworks out there (which is ...
3
votes
2answers
54 views

Composition model class with edit feature

I have a model class like below. I need to edit items, but the model has to know when any object has been modified. Also I need to provide very often with the objects inside to the view, which is who'...
0
votes
0answers
48 views

How should i handle deeply nested data with codeigniter/mvc?

I want to build a website with categories, pages, sections and slides. Hierarchically it should look something like this: [category 1] [page 1] [section 1] [slide 1] ...
0
votes
3answers
117 views

My ASP.NET MVC controllers seem like in mess

I am developing program with asp.net MVC and I feel like I'm doing it wrong in these parts: I'm populating all process in controller, because I don't know how to put it in model (how to call it). I ...
0
votes
0answers
47 views

Serializing .NET object into a JSON string produces unreadable output [migrated]

I'm trying to convert a .NET object into a JSON string, because I want to be able to read the content of this object in the client side. Here is my controller code: public ActionResult Index(...
0
votes
1answer
52 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 ...
4
votes
1answer
87 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 ...
3
votes
1answer
104 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). ...
3
votes
2answers
46 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 ...
1
vote
0answers
50 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
votes
2answers
114 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 ...
4
votes
2answers
159 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 ...
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 CarView-...
1
vote
1answer
70 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: http://codereview....
0
votes
3answers
63 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 ...
4
votes
1answer
247 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 ...
0
votes
0answers
34 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
129 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 ...
0
votes
0answers
24 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; } ...
1
vote
1answer
145 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 ...
1
vote
2answers
141 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
votes
1answer
122 views

Code structure of third party framework [closed]

Is an API always returning 200 OK, an issue?
1
vote
4answers
82 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
62 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
103 views

MVC as a subset of client-server architecture?

Can we say that MVC is subsystem (or subset, sub-architecture) of client-server architecture?
0
votes
1answer
57 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
213 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 ...
1
vote
3answers
82 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
132 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 ...
3
votes
3answers
92 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
190 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 ...
7
votes
4answers
248 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 ...
2
votes
3answers
126 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) { ...
2
votes
2answers
420 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 ...
3
votes
1answer
55 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, ...
2
votes
2answers
117 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, ...
1
vote
1answer
116 views

How far do I separate Model code from Controller code when writing MVC?

I have some code where Controller depends on the Model, and in my case Model acts like a Database Access Object. use FQDN\Model; class Controller { /** @var FQDN\Model */ private $model; ...
7
votes
2answers
164 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 (...
6
votes
3answers
540 views

Why does everyone put controllers in one folder and views in another?

I'm getting ready to take the bend out of asp and into an mvc framework, asp.net mvc or nancy. Wherever I go, I see folders for controllers/modules and folders for views. Is this just a pavlovian ...