Tagged Questions
69
votes
10answers
18k views
What is MVC, really?
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 ...
34
votes
6answers
16k 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 ...
32
votes
5answers
2k views
What are the downfalls of MVC? [closed]
I've been using MVC/MV* since I started actually organizing my code years ago. I've been using it so long that I can't even think of any other way to structure my code and every job I've had after ...
28
votes
11answers
2k views
Is the 'C' in MVC really necessary?
I understand the role of the model and view in the Model-View-Controller pattern, but I have a hard time understanding why a controller is necessary.
Let's assume we're creating a chess program using ...
21
votes
7answers
1k views
MVC Architecture — How many Controllers do I need?
I have been coding for a while, but mostly scripts and simple applications. I've moved into a new role where it is all about developing Web Apps and using a proper MVC architecture, so I am ...
17
votes
6answers
2k views
How much business logic should be allowed to exist in the controller layer?
Sometimes we have some business logic represented in the controller code of our applications. This is usually logic that differentiates what methods to call from the model and/or what arguments to ...
14
votes
6answers
853 views
Strategies for avoiding SQL in your Controllers… or how many methods should I have in my Models?
So a situation I run into reasonably often is one where my models start to either:
Grow into monsters with tons and tons of methods
OR
Allow you to pass pieces of SQL to them, so that they are ...
14
votes
2answers
3k views
Alternative patterns for web development? (non-MVC)
Recently I've been reading some blog posts regarding MVC and how it doesn't fit the web. I've learned about alternative patterns like the RMR Architecture.
I'm curious what other patterns people are ...
13
votes
13answers
2k 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 ...
12
votes
7answers
2k views
Does MVC apply only to web
It is almost and instantaneous whenever I talk to developers about Model View Controller (MVC) they say you make a request to a url the server builds a entity (MODEL) and provides you with visual ...
12
votes
2answers
3k 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 - ...
10
votes
1answer
723 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
7answers
337 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 ...
9
votes
4answers
2k views
On MVC can several views have the same controller or one view must have one unique controller?
I'm having some questions while designing a architecture for a project around MVC. (It's a C++/Marmalade SDK project, I'm not using any particular MVC framework, I'm making one.)
On several articles ...
8
votes
4answers
507 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 ...