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

learn more… | top users | synonyms

6
votes
2answers
2k 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
8k 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 ...
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 ...
2
votes
1answer
404 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 ...
7
votes
3answers
320 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, ...
10
votes
3answers
2k 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 ...
0
votes
1answer
460 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
147 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 ...
3
votes
2answers
353 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
602 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 ...
-3
votes
1answer
489 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
765 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 ...
4
votes
5answers
2k 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 ...
4
votes
2answers
268 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
542 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
2answers
1k 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 ...
6
votes
2answers
1k views

MVC and delegation

I am a beginning iOS programmer and use the Model-View-Controller model as a design pattern: my model doesn't know anything about my view (in order to make it compatible with any view), my view ...
22
votes
2answers
9k 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
656 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
700 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
260 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 ...
10
votes
7answers
499 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 ...
14
votes
8answers
3k views

How do you organize your MVC framework while supporting modules/plugins? [closed]

There are a two main codebase structures that I have seen when it comes to MVC frameworks. The problem is that they both seem to have an organisational bug that goes with them. Standard MVC ...
1
vote
1answer
671 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 ...
11
votes
4answers
5k views

Why would you use MVC over Web Forms?

Recently an architect described our company as offering a Rolls-Royce solution (MVC) when all he needed was a Toyota (Web Forms). I'm curious to find out what you think about web forms vs MVC as an ...
5
votes
3answers
748 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 ...
7
votes
4answers
5k 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
1answer
78 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 ...
0
votes
2answers
131 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 ...
1
vote
2answers
863 views

Did I Inadvertently Create a Mediator in my MVC?

I'm currently working on my first biggish project. It's a frontend facebook application that has, since last Tuesday, spanned some 6000-8000 LOC. I say this because I'm using the MVC, an ...
1
vote
2answers
780 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
99 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 ...
10
votes
2answers
10k views

Use-cases for node.js and c#

I do quite a bit of ASP.NET work (C#, MVC), but most of it is typical web development. I do Restful architecture using CRUD repositories. Most of my clients don't have a lot of advanced requirements ...
0
votes
1answer
63 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 ...
5
votes
2answers
861 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 ...
2
votes
4answers
231 views

Views : ViewControllers, many to one, or one to one?

I have developed an Android application where, typically, each view (layout.xml) displayed on the screen has it's own corresponding fragment (for the purpose of this question I may refer to this as a ...
0
votes
1answer
695 views

PHP MVC error handling, view display and user permissions

I am building a moderation panel from scratch in a MVC approach and a lot of questions cropped up during development. I would like to hear from others how they handle these situations. Error ...
7
votes
3answers
389 views

Architecture of interaction modes (“paint tools”) for a 3D paint program

We are developing a Qt-based application to navigate through and paint on a volume treated as a 3D pixel graphic. The layout of the app consists of three orthogonal slice views on which the user may ...
1
vote
3answers
8k views

In MVC , DAO should be called from Controller or Model

I have seen various arguments against the DAO being called from the Controller class directly and also the DAO from the Model class.Infact I personally feel that if we are following the MVC pattern , ...
3
votes
2answers
1k views

What is the relationship between the business logic layer and the data access layer?

I'm working on an MVC-ish app (I'm not very experienced with MVC, hence the "-ish"). My model and data access layer are hard to test because they're very tightly coupled, so I'm trying to uncouple ...
1
vote
1answer
414 views

ASP.NET MVVM Handling multiple Data Transfer Objects on a single page

I have an asp.net mvc "edit" page which allows the user to make edits to the parent entity, and then also "create" child entities on the same page. Note: I'm making these data transfer objects up. ...
9
votes
1answer
364 views

Model-View-Controller (MVC) Which component handles save/load operations?

In a traditional MVC application, which component (model, view, or controller) is responsible for reading/writing the model to/from disk?
2
votes
1answer
1k views

PyQt application architecture

I'm trying to give a sound structure to a PyQt application that implements a card game. So far I have the following classes: Ui_Game: this describes the ui of course and is responsible of reacting ...
0
votes
1answer
344 views

In PHP, what are the different design patterns to implement OO controllers as opposed to procedural controllers?

For example, it's very straightforward to have an index.php controller be a procedural script like so: <?php //include classes and functions //get some data from the database //and/or process a ...
5
votes
4answers
407 views

Where is it permissible to add logging code in a MVC model?

Working on a C# WinForms program that is written in a MVC ( actually Model-View-Presenter) style and I want to add a few lines of code that is responsible for logging some events. Where should I ...
21
votes
9answers
3k 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 ...
6
votes
2answers
1k views

Observing MVC, can/should the Model be instantiated in the ViewController? Or where?

I'm writing an experimental iPhone app to learn about the MVC paradigm. I instantiate my Model class in the ViewController class. Is this stupid? I'm asking because storing the id of the Model class, ...
8
votes
4answers
10k views

One controller per page or many pages in one controller?

I just wanted some advice regarding the MVC way of doing things. I am using codeigniter and I was wondering if it's better to have one controller per page for a website or to have one controller for ...