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

learn more… | top users | synonyms

3
votes
1answer
2k views

Opensource showcase for MVC in Java Swing [closed]

I've allready created small desktop CRUD applications using Java/Swing. In hindsight I'm not quite sure if the overall design of these applications is good. I've also done some reading on MVC and ...
3
votes
2answers
764 views

Organizing MVC entities communication

I have the following situation. Imagine you have a MainWindow object who is layouting two different widgets, ListWidget and DisplayWidget. ListWidget is populated with data from the disk. ...
0
votes
1answer
78 views

Is there a typical way of having a view that is a dependent on another?

I am working on a program with two views, html and ajax (which will be html transmitted via json). The HTML view is the standard, and by default the ajax should look the same. However, the ajax view ...
15
votes
5answers
7k views

In an MVC system, where should the database persistence code sit?

I've seen multiple configurations for persisting information to the database. Generally, three types of designs seem common in my corner of the world: Controller manages the persistence Model ...
8
votes
2answers
1k views

Should the controller pass data to a view in the MVC pattern?

I work with ASP.NET MVC (and other web-based MVC implementations) quite often, but this is something I've never been sure of: Should controller and view communicate? Of course the controller should ...
1
vote
8answers
544 views

Should PHP view files be called something other than '.php'?

By default, any file that PHP touches is usually suffixed with .php. It's universally understood by Apache / Nginx as the default for PHP files and most setups expect PHP files to end in this ...
11
votes
3answers
7k views

Handling Errors In PHP When Using MVC

I've been using Codeigniter a lot recently, but one thing that gets on my nerves is handling errors and displaying them to the user. I've never been good at handling errors without it getting messy. ...
2
votes
1answer
2k views

Difference between Controller and Dispatcher in MVC for web frameworks?

In MVC applied to WSGI or Java EE, is the Servlet a controller, dispatcher, or both? I think I've seen system diagrams where the controller and the dispatcher are different. Could the controller ...
0
votes
2answers
1k views

Using alternative MVC framework

I am new to ASP.NET MVC and EF. I read about open source implementations of MVC pattern like Spring, FubuMVC, Castle etc. I want to know how flexible these alternatives are when compared with ASP.NET ...
3
votes
4answers
2k views

Can you call any php model class in an MVC from the controller?

I'm creating a simple MVC at the moment and am wondering if it's 'correct' to be able to call any model class directly from the controller to get the data to send to the view? I have the following ...
5
votes
2answers
2k views

How can I design a model layer without ORM, and when should I use it?

I'm a PHP developer who started with CodeIgniter. In it, designing models was easy: it seemed like each method defined in models was the equivalent of static methods in a normal, objected-oriented ...
7
votes
1answer
516 views

Defining classes in JavaScript that exist in your back-end

Doesn't it seem relatively duplicative to define your Models in your backend code AND on your front end for a rich internet application? I'm porting a GUI application I had written to have a web ...
99
votes
10answers
61k views

What is MVC, really? [closed]

As a serious programmer, how do you answer the question What is MVC? In my mind, MVC is sort of a nebulous topic — and because of that, if your audience is a learner, then you're free to ...
5
votes
5answers
2k views

Where should date formatting take place in an MVC pattern?

Suppose that you want to show a user list, on a web application having to handle custom date formats (depending on current selected interface language). Several locations for applying the date format ...
2
votes
2answers
135 views

Pattern for user interaction and confirmation

Suppose a FileWriter class that needs validation that it will not erase a file already present, if one is found. It would have two functions: public bool FileExists(string filePath) //... public bool ...
1
vote
1answer
229 views

Pattern for a web application

I'm developing a web application for a university project. My professor wants we to use a multi-tier architecture (Client, Web, Business and Data tiers) with EJB. For the Web and Business I have ...
0
votes
1answer
374 views

MVC JSon Request architecture

I am finding myself building up a whole bunch of JSON calls all through my application, which are basically actions spread across various controllers. I am considering creating a JSON Controller to ...
3
votes
1answer
1k views

Are JavaScript MVC Frameworks only for 'single-page' apps?

I've been looking into several of the JavaScript MVC Frameworks (Backbone.js, Spine, SproutCore,etc.) and it seems to me that all of these are designed to act as 'single-page' applications. All of the ...
10
votes
2answers
11k 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 ...
14
votes
13answers
3k views

Where is the M in MVC?

I'm trying to refactor my application into MVC, but I'm stuck on the M part. In a database-backed app, the model is implemented in the app code, right? But then, what is in the database -- is that ...
0
votes
2answers
855 views

A good substitute for ASMX web service methods, but not a general handler

The best thing I like about ASP.NET MVC, is that you can directly call a server method (called action), from the client. This is so convenient, and so straightforward, that I really like to implement ...
4
votes
2answers
1k views

Controllers in CodeIgniter

I little bit new to the CodeIgniter framework and this is my first project with this framework. During a chat on StackOverflow somebody said that we need to make controllers tiny as possible. ...
0
votes
2answers
801 views

Who can change the View in MVC?

I'm working on a thick client graph displaying and manipulation application. I'm trying to apply the MVC pattern to our 3D visualization component. Here is what I have for the Model, View, and ...
6
votes
2answers
2k views

How is the facade pattern different from abstraction layers?

I just read about the facade pattern and found this example where a client (user of a computer) invokes a startComputer() method which calls on all the complex stuff: Source: wikipedia /* Complex ...
4
votes
2answers
702 views

What is jQuery and JavaScript's role in MVC?

I'm not sure I understand the role of jQuery/JavaScript in MVC. I've found an article about it on A List Apart, but it doesn't clear anything up for me. Does it bridge the communication between the ...
7
votes
3answers
515 views

Why decouple view and controller (web)?

Why can't we put them in the same page, like each action paired up with its view? Not using code island, but controller code at top then view code at bottom? What are the problems with this approach? ...
5
votes
4answers
422 views

Multiuser System With Encrypted Database

I am currently developing a hosted solution in ASP.NET using MVC3 and Entity Framework. This product will then be made available to a number of clients as a hosted solution. As the data stored by ...
4
votes
1answer
243 views

Are Session implicit objects examples of Models in MVC?

I have read that the Model is responsible for maintaining state among HTTP requests, for example in this article: The Model is responsible for maintaining state between HTTP requests. ...
1
vote
3answers
1k views

Organising MVC App with virtual model using external API

I am creating a rails app with following constraints It has no database It uses a web API to store and retrieve the data The connection to the web API is via a custom gem. The Gem has a basic ...
4
votes
1answer
583 views

Model independency in MVC and most efficient way to do method calls

TLDR: Are models supposed to be application-dependant and totally worthless when starting a new application, or are you supposed to design models independently so that they act as stand-alone ...
2
votes
3answers
558 views

RFC: Extending the MVC Design Pattern

I've been using the MVC pattern in my applications for years (with full separation of the controller from its views). Having to implement several hundred views to represent a little over 100 model's ...
7
votes
1answer
2k views

How to divide work among development team members in a website project using MVC pattern

I am working on a webapp project using flask framework and sqlalchemy orm in python. Its the first time I am working on a project like this and I am having trouble in how to divide work properly among ...
3
votes
2answers
4k views

Packages organisation with MVC design pattern [duplicate]

I have been programming quite a lot now and still can't decide which of these packages hierachies was the best: package1 Class1Controller Class1Model Class1View package2 Class2Controller ...
7
votes
2answers
2k views

Decoupling UI code?

In my application I have several event handlers that perform some action in response to user interface events such as a button click or menu selection. The code in these event handlers looks like ...
1
vote
2answers
733 views

Storing page-specific javascript on an AJAX driven site?

I have a general question about the placement of javascript code in a AJAX-driven web application. At a previous job, we tended to throw everything in one monolithic file. When maintaining that file ...
6
votes
1answer
620 views

If multitenancy is a priority, should I store site content in the database?

I have a multi tenant ASP.NET MVC website and all client specific text is stored in resource files. Every time someone wants to change text I have to jump through hoops and fill out forms and let ...
-1
votes
2answers
645 views

why use a form object when you can get needed data from view object's html?

I am working with server side code. I have a request object that handles request data validation and filtering. I have a view object that uses template files to generate html for output. the ...
5
votes
1answer
704 views

How can I manage my ViewControllers in my game?

I'm building a very simple iOS game that doesn't require any fancy OpenGL; I'd like to stick with Core Graphics & Core Animation. I'd like to make this a fullscreen game, and my question is of ...
2
votes
2answers
803 views

Obtaining the best of both worlds: MVC and WebForms

Rather than asking a general question about WebForms vs MVC (such as in ASP.NET v/s ASP.NET MVC), I have a specific quesiton. It appears the main differences between the two approaches are WebForms ...
3
votes
5answers
1k views

Controller vs Model: Where do I put the processing of user input?

I'm new to MVC and I'm not using a framework (and I'm not going to). I'm designing my new web application using MVC. I have the user input received in Controller. Suppose I have form data and an ...
3
votes
2answers
339 views

New PHP project, how to best architect it

I have already done a PHP project, and I did a number of things pretty wrong :) I just had all pages as scripts with php mixed in with html. I also wasn't using a framework like cakephp. And I didn't ...
1
vote
2answers
2k views

Do modular PHP frameworks really improve applications?

One of the goals of modular frameworks like Kohana or Alloy is to make it easy to add and remove components (i.e. "plugins" or "modules"). However, in all the larger projects I have ever worked - the ...
7
votes
3answers
481 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 ...
3
votes
1answer
148 views

Workflow for a plugin assignment

I'm starting a new project in PHP, a plugin for a website that grabs additional data from it through cURL, getContents etc and re-tabulates it in excel. It's a local project, basic script like with a ...
11
votes
1answer
1k views

Patterns for ajax-heavy web applications

Up until now, I've been a great fan of the MVC pattern for developing web applications. For the web, I've developed mostly in PHP (with the Kohana and CodeIgniter frameworks) and Ruby (RoR). As my ...
9
votes
3answers
845 views

What is the object-oriented thought process? [closed]

I've been studying OOP in conjunction with Zend's MVC implementation for the past few months. I'm pretty new to programming, generally, but I feel strongly that I should learn things the 'right' way, ...
53
votes
7answers
47k views

Why should I use an MVC pattern?

It seems everyone doing web applications nowadays wants to use MVC for everything. I find it hard to convince myself to use this pattern, however. I understand the general idea is to separate the ...
1
vote
1answer
778 views

Model-View-Controller and client-side concurrency responsibility

In a web application that has a significant ajax component, where is the best place for the client-side concurrency responsibility to lie? We're trying to use MVC on both the server application (LAMP ...
12
votes
4answers
2k views

What are the disadvantages of using/writting a .Net Custom Membership Provider?

Recently, I posted the following question on SO: http://stackoverflow.com/questions/7197337/using-asp-net-membership-provider-with-an-existing-user-database As you may notice, I ended up answering my ...
8
votes
1answer
330 views

How to make models do more than setting and getting data and validation

I am asking this question because after developing a few small custom cms solutions in a framework, I developed the idea that Models can be easily substituted with ORMs which ease up the task of ...