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

learn more… | top users | synonyms

3
votes
1answer
189 views

Ambiguous use of “Controller” in MVC

I have heard two separate uses for the term controller when speaking of the Model View Controller methodology. An intermediary section of code that communicates between the Model and View, tying ...
4
votes
1answer
771 views

The Service class in MVC

From time to time I find there is a need to build a service class. Something I can't really attach inside a model in order to respected GRASP and SOLID. So I created a class called ...
5
votes
1answer
289 views

Architectural questions regarding, MV** frameworks, NoSQL data models, and gradual refactoring

I have a web app I would like to gradually refactor by adding structure to it. I have narrowed down the options to Backbone (with some plugins), Ember.js and AngularJS My goal is to refactor that ...
5
votes
2answers
218 views

method to allow me ability to freely modify my classes, but make them immutable to others?

I am creating the model part of an MVC architecture. My one class will provide all the accesses to allow one to fetch system state. I want most of this state to be immutable as it shouldn't be ...
0
votes
2answers
189 views

What is a good technique to prevent unauthenticated users from accessing controller methods?

I have an event(s) controller: class Event extends CI_Controller{ public function index(){ } public function foo(){ } //Shouldn't be able to use this method unless logged in ...
6
votes
2answers
588 views

Why is using named routes for generating outbound URLs a violation of Separation of Concerns?

What is separation of concerns? In computer science, separation of concerns (SoC) is the process of breaking a computer program into distinct features that overlap in functionality as little ...
0
votes
1answer
1k views

ASP.NET MVC Web Site & WCF Web Service - Sharing functionalities

I have the following situation: I have to create a website and a web service that will share a part of the functionalities. This is why I do not want to write code twice. I have thought of the ...
0
votes
1answer
684 views

Problems for Sample Code [closed]

I was recently asked to write some sample code that solves a difficult technical problem. I've been mulling over what kinds of problems might be good to solve in code to demonstrate my skills in such ...
2
votes
2answers
734 views

How to use MVC in practice

I'm very confused. I can't even begin to understand how MVC would be implemented outside of web development. This might seem like too general a question, but how would one apply MVC. I have the ...
5
votes
2answers
1k views

Can REST API be used as business layer?

I am using PHP Codeigniter MVC design pattern and I had this project with some sort of specific business processes In my application I will be dealing with 2 existing REST APIs: Google Trello ...
4
votes
2answers
6k views

What is Delegation and why is it important in iOS programming?

At the moment I am teaching myself iOS programming, and one concept I find really hard to wrap my head around is delegation. What is it? Why and how is it used? What is the advantage? The technical ...
4
votes
1answer
684 views

How to achieve N-Tier type in Codeigniter MVC [closed]

I know that N-Tier intended to separate layers on different network but I would like to have the same code separation in codeigniter I got this idea to have Model : for database CRUD - > Data layer ...
3
votes
2answers
1k views

Codeigniter/MVC workflow

Bit of a workflow question. I'm just staring with MVC and wondered how other people usually work in MVC? The 2 options I see is to code the model and controller completely first and then work on the ...
7
votes
3answers
306 views

Is it safe to assume that one controller will only ever use one primary model?

So, I'm designing an MVC framework. In the name of keeping everything statically typed and non-magical, I've come to quite a problem with "automatically" passing models to a controller. So, ...
9
votes
3answers
1k views

Is the term 'Front-End' synonymous with 'Client-Side'? If so, is this always the case?

As a relatively new (self-taught) web developer, I've heard the terms front-end, client-side, back-end, and server-side quite often. To me, front-end and back-end were always synonymous with ...
2
votes
2answers
2k views

How to synchronize client and server model objects?

We have a client-server application with a thick client (GWT). There are client-side MVP presenters (MVC controllers) which hold references to some objects viewed in the GUI. Some user actions cause ...
0
votes
1answer
431 views

Implementing a Service Layer with MVC4 while honoring Single Responsibility

I'm trying to learn some best practices while I ramp up on MVC4. I have a solution with three projects: Web: MVC stuff Core: Data Model Tests: Testing classes I'm now trying to add: Services: ...
0
votes
2answers
250 views

What is this variation of MVC in JavaScript?

I am working on sorting out my Javascript code. Currently I have views implemented without any Model or collection. Now I working on separating Model from View. So for this transformation, I am ...
0
votes
2answers
140 views

Which controller should I put for a search action that touches many different models?

I currently have the following models and am designing search functionality that searches within these 3 models: Locations Users User_friends Should I create a search controller or should I put the ...
1
vote
1answer
920 views

Handling error message for a Spring MVC login form

This can apply to many error handling scenarios, but I'm curious about how to do it in a login scenario. Given this Spring controller method: @RequestMapping(value = "/account/login", method = ...
0
votes
3answers
615 views

How to make ASP .NET MVC website have a continuous process running?

This website is supposed to be a game where the players have some 'buildings' and these buildings produce resources. E.g. an iron mine may produce 30 pieces of iron ore per minute and automatically ...
2
votes
2answers
302 views

Is it reasonable to build applications (not games) using a component-entity-system architecture?

I know that when building applications (native or web) such as those in the Apple AppStore or Google Play app store that it's very common to use a Model-View-Controller architecture. However, is it ...
-1
votes
1answer
480 views

Migrating from PHP to ASP .NET MVC [closed]

I plan on migrating a website from PHP to ASP .NET MVC. However, since the website is large and this migration can't be done in a short time I plan to use both MVC and PHP pages together. So the idea ...
2
votes
1answer
361 views

Does it violate the DRY principle to use an MVC server-side framework and a client-side MVC framework

When using a MVC pattern for server side code (in my case django), the model definition is defined once in the model component. When using a client side MVC based library(in my case backbone) the ...
-3
votes
1answer
438 views

Does anyone knows a good minimal php mvc framework? [closed]

I've been developing using frameworks since the last year, and is true that those pieces of software really help me and improve my development, that's until you need to fulfill your client's dreams, ...
4
votes
5answers
2k views

Should Controller know about View & Model? or vice versa?

I'm conceptually trying to understand if I should be doing this: item = Model() screen = View() brain = Controller(item, screen) or this.. brain = Controller() item = Model(brain) screen = ...
4
votes
1answer
581 views

MVC Pattern - How to get errors from the model to the controller?

Say I have a typical MVC setup. The controller passes on some input to the model, and asks it to do something with it. But the validation of the data fails, or there is some other problem. What's the ...
9
votes
4answers
1k views

In MVC, can/should basic data retrieval from the Model be done in the View?

Given the concept of 'skinny controllers, fat models' and the general acceptance that Views can directly call on Models when requiring data for output, should one consider handling the 'get and ...
4
votes
2answers
251 views

MVC - Isolating view and model logic

I understand that the model should generally consist of data manipulation and the view for data display from the model, but how do I keep my model and view layers decoupled? My simple view has a few ...
2
votes
1answer
466 views

MVC - sharing multiple models

I am building a java desktop application where I am attempting to implement MVC. The GUI interface has multiple views (think pop-up windows) from the main view. Each view has its associated model that ...
3
votes
5answers
1k views

MVC exposes database primary keys?

I'm going through a MVC tutorial, and I notice that convention seems to be to expose a tables primary key on detail pages/urls (ie. /Movies/Details/5 as an example from the tutorial). It's obviously ...
3
votes
2answers
861 views

Service layer design

I am developing an MVC website in PHP, and for the first time, I would like to implement a service layer. I have some design considerations I would like to get some advice on. The backend will by no ...
3
votes
4answers
650 views

mvc pattern on procedural php

First off, I do not have anything against OO programming (I'd be mad if i believed so). But I was thinking on some sort of procedural MVC pattern with PHP; let me explain better. As we all know, ...
19
votes
2answers
8k views

MVCS - Model View Controller Store

I recently decided to start learning iOS Development, and to this end I’ve been reading iOS Programming: The Big Nerd Ranch Guide. In the book the authors describe a design pattern MVCS - ...
1
vote
1answer
572 views

MVC 3 Page design; split pages into Many partials?

I am currently working on an MVC 3 Web app project where I need to display a lot of information on the front page. I am relatively new at web page layout and design so I have hit a wall in terms of ...
0
votes
3answers
1k views

Migrating legacy procedural code to MVC without rewriting [closed]

I recently started working on a PHP application that was built many years ago before the advent of objects and namespaces in PHP. The code is procedural, does not separate presentation logic from ...
2
votes
1answer
658 views

Newbie ASP.NET developer being forced into MVC4 with WebForms

I recently got hired on as a new ASP.NET developer (C# code behind). When I arrived, I was told that they were moving to MVC 4, and so I bought two books on that. However, the other day I learned ...
2
votes
1answer
241 views

In JSF where do objects like PhaseListeners fit in the MVC pattern?

When it comes to JSF, I've had trouble distinguishing where certain objects I create fit into the overall MVC pattern. The View is simple enough since that's handled by the .xhtml template but when ...
9
votes
7answers
457 views

Is the use of security conditionals in a view a violation of MVC?

Often what's displayed to a user (e.g. on a web page) will be based partly on security checks. I usually consider user-level / ACL security to be part of the business logic of a system. If a view ...
1
vote
1answer
591 views

Should one declare alternative response types (e.g. JSON) in Rails controller actions even if not utilising them?

Just wondering what the accepted convention is for Rails controller design. Currently, every controller in my app that I've written it set up to send a JSON response when necessary. Thing is, I only ...
5
votes
3answers
609 views

Where do the parser and service objects fit in MVC?

Do NSURLConnection service objects and XML/JSON parser objects fall within the controller layer or the model layer? Why? Is it OK to have business logic in the controller? Or should it be in the ...
1
vote
1answer
150 views

Good resources for a MVC.Net developer going back to WebForms? [closed]

Well it looks like I may be forced to build a new system in webforms after having worked exclusively in MVC for the last 3 years. Initially I didnt think this was going to be a problem except the ...
1
vote
1answer
74 views

For a front-end application broken down in a MV* manner, should I have models dedicated to UI logic?

I am not talking about simple UI logic like clicking a button directs you to another page, but where one action may result in several different of behavior depending on current application state, and ...
7
votes
4answers
4k views

Using MVC in a Java app

I need to write a cross-platform GUI application to process (in multiple threads) and visualize fairly large quantities of data. Ideally the application should be relatively fast and look good. The ...
1
vote
2answers
681 views

Implement service layer in MVC

We have a defined service layer hosted in WCF. We are now building a website that will need to use the services functionality. The website is being written in ASP.NET MVC 4 and I'm trying to decide ...
1
vote
1answer
97 views

Fitting an established site into a CI framework

I manage a rather large, feature full nightmare of a site which has no end of feature creep settings/options/etc. Up to now its been coded in a procedural/functional way and would like to move to an ...
0
votes
1answer
62 views

How properly perform passing operation result to View

I'm developing web site on self made MVC engine. I have actionController that handles operations like register, login, post submit and etc. actionController receives operation name and parameters. Of ...
0
votes
2answers
123 views

How to handle notifications to several partial views of the same model?

I am working on refactoring an old simulation of a Turing machine. The application uses a class that contains the state and the logic of program execution, and several panels to display the tape ...
15
votes
4answers
10k 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 ...
3
votes
2answers
676 views

Are session aware Models a bad thing?

I'm thinking specifically in Rails here, but I suspect this is a wider question. In a Rails web application I'm using data from the session in models in order that the models know who is logged in. I ...