Questions tagged [model-view-controller]

Model–View–Controller (MVC) is an architectural pattern, introduced in mid 1970-s in PARC into how to compose software interfacing also with user-interactions. For Microsoft ASP.NET MVC, please use [asp.net-mvc] or [asp.net-core-mvc] tag instead. For Spring MVC, please use [spring-mvc] tag instead.

Model–View–Controller (MVC) is an architectural pattern used in software engineering, since Palo Alto Research Centre released one such in mid 1970-ies, designed in Smalltalk-79 language.

The pattern isolates "domain logic" (the application logic for the user) from the user interface (input and presentation), permitting independent development, testing, portability and maintenance of each (separation of concerns).

Image which demonstrates typical collaboration of the MVC components:

MVC

Reference

The analogy

MVC can be metaphorically related to a TV. You have various channels, with different information on them supplied by your cable provider (the model). The TV screen displays these channels to you (the view). You pressing the buttons on the remote controls affects what you see and how you see it (the controller).

33635 questions
5
votes
2 answers

Simple MVC mod-rewrite

I'm not sure how to do a mod-rewrite for a modular MVC structure. What I want to happen is the URL captures: http://domainname.com/index.php?model={model}&view={view}¶meters={parameters} NOTE: parameters will be in a specific order and…
Torez
  • 1,902
  • 7
  • 25
  • 39
5
votes
1 answer

how can I change the "get" and "set" on a Model Property?

Currently I have a DateTime property for a model. I am using the telerik MVC framwork but I am using a DateTime property and the editor column for this property is auto-generated so there is no code which controls it in my View or Controller. On…
5
votes
4 answers

Codeigniter controller and model with same name collison

I'm try something from this comment idea Code Igniter Controller/Model name conflicts find class name variable on core/CodeIgniter.php : $class = $RTR->fetch_class(); and change like that: $class = 'Controller' . $RTR->fetch_class(); now change…
musa
  • 1,457
  • 18
  • 37
5
votes
2 answers

SignalR: client disconnection

How does the SignalR handle client disconnection? Am I right if I state the following? SignalR will detect browser page close/refresh via Javascript event handling and will send appropriate packet to server (through the persisting…
pavel.baravik
  • 689
  • 1
  • 11
  • 21
5
votes
2 answers

Is there any super controller or global controller in Codeigniter

I want to call a function in a controller (say controller_a) from another controller (say controller_b) Please help me ..
SG_
  • 1,316
  • 14
  • 26
5
votes
3 answers

Is it OK to use HTTP redirects in a RESTful MVC framework?

I'm trying to develop an MVC framework. When a user creates a new record it seems to make sense to me to then display the new record if it is successfully created. Is it ok to use a http redirect to move the user to a view of the new record?
jx12345
  • 1,650
  • 2
  • 22
  • 40
5
votes
4 answers

Why is the MVC concept important?

The Model View Controller concept is expressed all over the place as an important thing to keep in mind when developing an application. But when developing applications, I struggle to distinguish whether or not I'm using the MVC model and whether or…
Seany242
  • 373
  • 7
  • 20
5
votes
1 answer

How can I handle large JSON input from Postmark in my MVC application?

This is related to this question, but in this case it's not something I am returning but rather the model binding. I am using Postmark to handle incoming emails, which posts to a page with a JSON payload. I have a model as below and an action that…
5
votes
1 answer

Using Signals for communicating between classes

I want to use signals for communicating between my view and my application controller. I have following approach but since I'm beginner in PyQt I don't know if that is the right one. Can anyone tell me If I am on the right path or are there better…
Razer
  • 7,843
  • 16
  • 55
  • 103
5
votes
1 answer

How do you use ember-rest controllers to work with Rails3 nested resources?

I am newbie in client side Javascript MVC, first ember.js app. I follow the instructions here to use ember-rest in creating a post-comments type of nested models. http://www.cerebris.com/blog/2012/01/26/beginning-ember-js-on-rails-part-2/ I started…
5
votes
2 answers

UIButton event not handled 1% of the time: who should I blame in my responder chain?

My application tends to sometimes lose track of what responder should handle a touch event. My situation: a XIB file defining 3 views: one view as the File's Owner's view 2 extra views that are added to the view hierarchy programmatically One of…
Mick F
  • 7,312
  • 6
  • 51
  • 98
5
votes
1 answer

Clients is null when trying to send message via signalR

I have the following hub in my MVC application from where I would like to send a simple message to my client side code: using SignalR.Hubs; public class Progress : Hub { public void Send(string message) { // Call…
5
votes
2 answers

MVC with node.js: expressjs, backbonejs, railwayjs

I'm going to build an app using a lot of interfaces for the user to insert data which should be stored in a database. I developed applications in PHP before using Symfony2. Now I want to use node.js but I'm not sure what to use expressjs,…
dplusm
  • 3,548
  • 2
  • 14
  • 6
5
votes
3 answers

Zend controller's predispatch method

I was reading this to understand zend's MVC Request Lifecycle. But i can't think of any cases in zend where i would use a controller's predispatch method , isn't the init method enough for the code that i want executed before controller's actions…
Mouna Cheikhna
  • 38,870
  • 10
  • 48
  • 69
5
votes
3 answers

ASP.NET MVC: Send email using SendAsync (System.Net.Mail)

is there any way in MVC to get the System.Net.Mail SendAsync to work, instead of the blocking Send method? I tried using it but hit the "Page starting an asynchronous operation has to have the Async attribute" error, which I obviously can't resolve…
Alex
  • 75,813
  • 86
  • 255
  • 348