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
3 answers

Inter-Controller communication in MVC / MVP

What is a good method for loosely-coupled inter-controller communication in MVC/MVP? For example, in a Quote, the user must create and add a new contact, or add an existing one. They choose to create a new contact. When complete, the contact is…
Neil McGuigan
  • 46,580
  • 12
  • 123
  • 152
5
votes
2 answers

Where to include SMS-functionality in an MVC application?

I'm planning on rewritting an application that uses Zend Framework and Twilio (for sending and receiving SMS messages). Looking back, I don't think I placed all of the SMS functionality in the right places. This has made upgrading the website…
Chris Laplante
  • 29,338
  • 17
  • 103
  • 134
5
votes
3 answers

Data Validation in MVC

Suppose i have a 'View' for filling up form for renting a DVD , as per MVC architecture , either of 'Controller' or 'Model', who is supposed to validate the form data? Thanks
Ravi Jain
  • 1,452
  • 2
  • 17
  • 41
5
votes
2 answers

When should I call removeObserver:forKeyPath from within a closing ViewController class that is observing a persistant Model class?

I have a ViewController class that has a property that is the model which I want to observe as properties on the model change. Within my model object I have a property that is periodically updated in the background of my application. As it…
5
votes
2 answers

Difference between Membership Provider in ASP.NET Webforms and MVC 3

Is there a difference in the working between the Membership Provider of Webforms and Membership Provider of MVC 3?
5
votes
3 answers

progress bars + MVC in Java =?

So I have this nice spiffy MVC-architected application in Java Swing, and now I want to add a progress bar, and I'm confused about Good Design Methods to incorporate a JProgressBar into my view. Should I: add a DefaultBoundedRangeModel to my…
Jason S
  • 184,598
  • 164
  • 608
  • 970
5
votes
6 answers

MVC, am I doing it wrong?

I'm trying to understand MVC thing and so far I know that it's used to separate business logic from the view logic (something as HTML and CSS), but I fail at point when I need to organize my files. Lets say that I have 3 files: form.php which is…
5
votes
4 answers

Passing parameters to Controller ..but NOT on the URL

Is there a way to pass a parameter to a controller without putting it on the URL? For example, http://www.winepassionate.com/p/19/wine-chianti-docg-la-moto has the value 19 on the URL. If you actually change that value to another, the page displays…
SF Developer
  • 5,244
  • 14
  • 60
  • 106
5
votes
1 answer

setTimeout(f,0) equivalent? why does it solve cross-browser issues?

The following method: Init: function (selector, settings) { setTimeout(function() { var s = { width: '100%', script_url: '/Content/Scripts/tiny_mce/tiny_mce.js', theme: "advanced", …
bevacqua
  • 47,502
  • 56
  • 171
  • 285
5
votes
6 answers

New window opens on click of actionLink

I have a requirment to invoke a controller method from the view page. On click of the link below the method should be invoked. @Html.ActionLink(item.InvoiceNumber, "SendPdfStatement", "Invoice", new { item.InvoiceNumber }, new {…
5
votes
3 answers

How to work with inheritance in objective-C (iOS sdk)

I just started to learn iOS programming and I have a problem with inheritance. There are 2 files. First file Header #import @interface ViewController : UIViewController { int x; } @end Implementation: #import…
KopBob
  • 1,051
  • 1
  • 9
  • 15
5
votes
4 answers

Dynamic change ViewStart layout path in MVC 3

In my MVC project has 2 Areas which is Admin and Client and I need to dynamic config Layout for Client side, In _ViewStart (in client) file will set layout for all of client page. Layout = "~/Views/Shared/_Layout.cshtml"; So if we need to change…
icepon
  • 197
  • 3
  • 9
5
votes
1 answer

Ext JS 4 - how to create multiple store instances and assign to views? (MVC)

How do you create unique instances of stores and assign them to views (I am ok with creating unique views and/or controllers if that's required)? A simple use case - I want to open multiple grid's (of the same type) with a list of records from a…
Scott Szretter
  • 3,938
  • 11
  • 57
  • 76
5
votes
2 answers

How to trigger different actions based on submit button in rails

I have a form with a list of stuff, and an action already in place to update items. I want to have another button, which when clicked triggers a different action to remove the selected items. = form_for @new_item,:url => {:controller =>…
Chris
  • 6,076
  • 11
  • 48
  • 62
5
votes
2 answers

Rails - Many Models in One View

I need to access multiple models from a single view. Previously, my links_controller was only used to provide link resources sorted in different ways. Now I would like to include a partial (I'm assumning) which shows the top users sorted by score…
1 2 3
99
100