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

learn more… | top users | synonyms

1
vote
2answers
239 views

Let a model instance choose appropriate view class using category. Is it good design?

Assume I have abstract base model class called MoneySource. And two realizations BankCard and CellularAccount. In MoneysSourceListViewController I want to display a list of them, but with ListItemView ...
2
votes
5answers
698 views

Would PMP or CEH(Certified Ethical Hacker) course be more useful to a junior ASP.Net web developer?

Only recently i moved into doing Asp.net web development work, with quite a fair bit on Asp.net MVC. I'm thinking of taking up some courses to further build up my profile. I'm having a touch decision ...
5
votes
2answers
343 views

MVC two models required?

I've been doing software for a long time, but almost all of it has been back-end centric. I recently decided to learn Swing and tried to apply MVC principles. I realize that in Swing the View is ...
12
votes
4answers
3k views

Should I include HTML markup in my JSON response?

In an e-commerce site, when adding an item to a cart, I'd like to show a popup window with the options you can choose. Imagine you're ordering an iPod Shuffle and now you have to choose the color and ...
2
votes
2answers
552 views

MVC, when to separate controllers?

I'm starting with MVC and have a newbie question. What would be the logic criteria to define what a controller should encompass? For example, say a website has a 'help' section. In there, there are ...
10
votes
4answers
4k 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. ...
1
vote
1answer
598 views

Performing user authentication in a CodeIgniter controller constructor?

In "The Clean Code Talks -- Unit Testing" (http://youtu.be/wEhu57pih5w), Miško Hevery mentions that "as little work as possible should be done in constructors [to make classes more easily testable]'. ...
0
votes
1answer
840 views

Actions and Controllers managing strategy in MVC apps

Can anyone name any usefull strategy/architectural pattern for allocating actions between different controllers when using MVC pattern for developing web application? I am now developing web app ...
1
vote
3answers
796 views

How important is it to implement a caching system in an MVC style framework?

I am writing my own PHP framework (...waits for the groans to subside) for the purpose of learning (best practices, design principals etc.) as I'm entirely self-taught and consequently there are gaps ...
3
votes
3answers
611 views

Is it best practice to have a file only of “includes/requires”?

I have 5-10 files on one server that all catch XMLRPC-PHP requests. There's about 20 lines of require_once in each one that are all the same. It'd make life simpler for me to create a separate file ...
7
votes
4answers
172 views

Controllers and re-factoring for maintainability / sensibility

I have read many posts similar to this on the site: however I still am questioning what is best in my situation (also the answers are contradicting from question to question). I have a website ...
2
votes
7answers
1k views

Architectural patterns for interaction beyond MVC? [closed]

We all know the venerable Model-View-Controller pattern used to design interaction [mostly] with human users. It is the de-facto standard in OOP environment. What are some other architectural ...
0
votes
4answers
2k views

Coding in 'core php' and separating logic from presentation

What are the various ways of acheiving this ? Can someone please guide me? I have to code a website for a friend (designer). The friend wants me to use core php and not any framework like codeigniter ...
2
votes
2answers
11k views

How to do MVC the right way

I've been doing MVC for a few months now using the CodeIgniter framework in PHP but I still don't know if I'm really doing things right. What I currently do is: Model - this is where I put database ...
4
votes
1answer
269 views

What is the best practice to develop a visual component in Flex Hero?

What is the best practice to develop a visual component in Flex Hero? I do it like this: I consider a component has 2 "parts", the declarative part (the visual sub-components) which I define in the ...
5
votes
3answers
575 views

Design Patterns for Coordinating Change Event Listeners

I've been working with the Observer pattern in JavaScript using various popular libraries for a number of years (YUI & jQuery). It's often that I need to observe a set of property value changes ...
4
votes
1answer
245 views

Using default parameters for 404 error (PHP with mvc design)?

I have a custom made Framework (written in PHP). It all works very good, but i have some doubts about a certain thing. Right now when a user call this url for example: http://host.com/user/edit/12 ...
3
votes
2answers
406 views

Question about modeling with MVC (the pattern, not the MS stuff / non web)

I'm working on an application in which I'm looking to employ the MVC pattern, but I've come up against a design decision point I could use some help with. My application is going to deal with the ...
2
votes
5answers
277 views

Organizing my products database

I’m developing a web-based store in MVC (very closely based on the SportsStore example in Pro ASP.Net MVC 3 Framework http://www.powells.com/biblio/61-9781430234043-0). I’m using a SQL database and ...
2
votes
1answer
635 views

Making Modular, Reusable and Loosely Coupled MVC Components

I am building MVC3 application and need some general guidelines on how to manage complex client side interaction between my components. Here is my definition of one component in general way: ...
4
votes
3answers
1k views

is it a bad practice to call a View from another View in MVC?

I have some plain Views, they don't have any logic behind them (there is no action or controller behind them), their only propouse is to alert the user about something like "We have sent you an email ...
1
vote
2answers
448 views

Javascript MVC in principle

Suppose I want to implement MVC in JavaScript. I am not asking about MVC frameworks. I am asking how to build it in principle. Let's consider a search page of an e-commerce site, which works s ...
3
votes
3answers
1k views

Transaction Design Pattern for MVC and location of responsibility?

I'm designing a pretty standard Spring MVC application, and I'm trying to figure out where the responsibility for transaction management should lie. I've been reading Java Transaction Design ...
5
votes
4answers
1k views

how to structure MVC models and ORM models

I have some trouble getting a good folder structure in my project and i would like to know what other ways i could use to structure my files. I'm currently working in an MVC sturctured folder. www/ ...
11
votes
4answers
2k views

Are Django forms violating MVC?

I just started working with Django coming from years of Spring MVC and the forms implementation strikes as being slightly crazy. If you're not familiar, Django forms starts with a form model class ...
9
votes
4answers
6k 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 ...
4
votes
2answers
629 views

Who should register input listeners: the controller or the view? (MVC)

I'm using an (C++) SDK (Marmalade) and building a project around the MVC pattern. On my app, user input listeners may be registered on certain UI elements/widgets/etc providing a proper callback ...
4
votes
1answer
213 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
566 views

Event driven design and separation of core/UI logic

I am new to event driven development, and I feel lost when I try to implement events that should pass the core/UI boundary. In my program I have the following (example in c#): UI.RuleForm ...
2
votes
1answer
114 views

How to verify the client's view is consistent with the remote model?

i'm designing a client-server system via web broswser and i have this problem: I send the data to the client via JSON, then the javascript view shows the stuff. Then the user takes actions and ...
2
votes
2answers
612 views

MVC: View-Controller Interaction

I have a Java application that I am implementing following the MVC pattern. I want to have a window (view) that contains a form which allows the user to add several text fields. There will also be a ...
1
vote
1answer
450 views

MVC, Java Design Pratices, and Flaws of java.util.Observable and java.util.Observer

I am planning learning Model-View-Controller (MVC) development using Java. While reading I came across a post which mentions java.util.Observer and java.util.Observable for MVC development. As I ...
1
vote
2answers
325 views

Trying to grasp the idea of DI/Unity and possibly apply it to our simple application

Our app basically is a few forms that are filled out by people.. Then these forms are validated and reviewed and reports are created.. So I was thinking about DI and messing with a simple example of ...
2
votes
3answers
505 views

Where does my database schema live in MVC?

I'm starting to check in the SQL files for creating/maintaining our database. Previously SQL files were kept totally separate from our codebase's version control. I'd like to pragmatically store my ...
0
votes
1answer
273 views

Learning MVC - Why does home and about share the same controller?

Let me start this out by saying I've been a asp.net web forms developer for a while now and that I understand mvc is a new way of doing things. As I'm learning mvc and going through tutorials and ...
0
votes
1answer
217 views

How Should a model and controller be distributed between subviews of the View?

In many User Interface libraries, we have concept of views and subviews. so according to MVC pattern every view should update the model as soon as it changes. For that view should have a reference ...
3
votes
1answer
138 views

How do I handle a Controller that's not controlling a specific Model?

I've got a nice MVC set up going but my website requires some views that don't map directly to a model. Specifically I've got some generic Reports users need to run, and now I'm creating a utility for ...
1
vote
2answers
235 views

What are some useful things you can do with Mvc Modelbinders?

It occurs to me that the ModelBinder mechanism in ASP MVC public interface IModelBinder { object BindModel(System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext ...
15
votes
6answers
1k 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 ...
2
votes
2answers
321 views

Where should SQL/DB Queries be encapsulated in a software system?

I frequently write small applications (either web based or otherwise) that require heavy database usage. i've attempted various ways of handling where to put the actual sql queries (sort of ad-hoc ORM ...
3
votes
2answers
431 views

Use controller in view in MVC

I have a problem convincing my team mates why we shouldn't use (directly reference) the controller in the view when developing components in the spirit of MVC. I have invoked decoupling and natural ...
2
votes
5answers
349 views

Should a web designer know server-side coding?

We're implementing an CMS based on ASP.NET MVC. Now, any designer should be able to provide themes for this CMS. But to write a theme, they need to be able to modify the generated HTML, thus the ...
2
votes
3answers
2k views

What is the actual purpose of MVC?

I've seen a lot of stuff that describes how it's done, but not a lot that tells WHY it's done. Is it just a way to keep the code readable, or is there a better reason?
0
votes
1answer
119 views

Places to store basic data

I am using PHP. I'm building a fully modular CMS, which is destined for the public. Some people might view this as a framework, but I intend to write a set of extensions for it, extensions that will ...
3
votes
1answer
948 views

Creating a shared library that might be used with desktop applications and web projects

I have been involved in a number of MVC.NET and c# desktop projects in our company over the last year or so while also managing to kept my nose poked into other projects (in a read-only learning ...
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 ...
3
votes
2answers
542 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
3answers
421 views

Need recommendation for transferring ASP.NET MVC skills to PHP [closed]

I am looking to translate my skills in .NET to PHP - specifically in regards to ASP.NET MVC. At work I am currently using .NET MVC 2.0 on a variety of projects and thoroughly enjoy the platform. ...
4
votes
2answers
2k views

Models per database table?

I am using codeigniter, and have found myself in a similar situation where I have repeated Model methods. I am creating a Model per Controller. But I would creating a Model per database table be ...
13
votes
7answers
8k views

Do experienced Ruby on Rails developers use scaffolding?

In the Ruby on Rails tutorial, I read something that suggested that experienced developers do not use scaffolding since they tend to like to just write the code to connect the MVC on their own. In a ...