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
6
votes
4 answers

Java MVC - Doesn't feel like I get it

As a beginner in programming it always bugs me when I run into a walls. Currently one of the wall are co-depending objects. As you can see in my question history I'm currently working on a blackberry application, in which I implemented something I…
Henrik P. Hessel
  • 36,243
  • 17
  • 80
  • 100
6
votes
1 answer

How to use the XPObserver unit contained in dunit's DUnitWizard, to implement an observer pattern, or even a MVC pattern?

There are good examples of Observer pattern in Delphi, thanks to the wise questions & answers on Stackoverflow, such as Best way to implement observer pattern in Delphi and Are there any Videos/Screen casts or other resources on how to use…
SOUser
  • 3,802
  • 5
  • 33
  • 63
6
votes
5 answers

How to encode and decode Broken Chinese/Unicode characters?

I've tried googling around but wasn't able to find what charset that this text below belongs to: 具有éœé›»ç”¢ç”Ÿè£ç½®ä¹‹å½±åƒè¼¸å…¥è£ç½® But putting and keeping that string into…
melaos
  • 8,386
  • 4
  • 56
  • 93
6
votes
1 answer

Lazy loading relationships in Django (and other MVCs/ORMs)

Interested in knowing how lazy loading is achieved in frameworks like Django. When is the decision made to perform the join? And is there a way to force eager loading in Django? Are there times when you would need to force Django to eager load?
nategood
  • 11,807
  • 4
  • 36
  • 44
6
votes
2 answers

In MVC architecture, where should password encryption take place

I'm working on creating basic password security on a medium size PHP CodeIgniter website. I need to start encrypting password that are being saved into a database. User passwords can be inserted using different methods including CSV import or an…
GrayB
  • 1,010
  • 8
  • 22
6
votes
2 answers

How to integreate Java FX and Spring MVC

I want to use JavaFx as a front-end in my web-application. My question is that is it possible to bind Model object with the form which is developed with Java Fx. I kindly request you to put some light on this issue. Please let me…
6
votes
1 answer

Data access and security in service layer (Doctrine & ZF)

We recently started using Doctrine 2.2, and parts of Zend Framework 2 in an effort to improve organization, reduce duplication, among other things. Today, I started throwing around ideas for implementing a service layer to act as a intermediary…
6
votes
3 answers

Scope of viewmodels in asp.net MVC 3

I have read online that it is bad practice to use a "kitchen sink" model: Rule #3 – The View dictates the design of the ViewModel. Only what is required to render a View is passed in with the ViewModel. If a Customer object has fifty…
Scott Weaver
  • 7,192
  • 2
  • 31
  • 43
6
votes
3 answers

Contains(), how to reverse using lambda

I have these 4 checkboxes, which constitute the string variables saljes, kopes, bytes, erbjudes. When they are checked they get the value "on". From this I put together a string variable (p) that contains all the numbers I want to include in the…
Mikael Edebro
  • 241
  • 2
  • 13
6
votes
4 answers

Please share your experience with JavaScriptMVC, alternatives

I have been reading through the documentation on the JavaScriptMVC framework and it looks interesting. I am wondering if anybody here has used the framework, and with what success. So please share your experience with JavaScriptMVC, if you have any.…
Egil Hansen
  • 15,028
  • 8
  • 37
  • 54
6
votes
1 answer

How to extend namespaces with EmberJS

I've been programming in Javascript for a while. Recently I made quite a huge jQuery project and applied the Module Pattern as described in this wonderful article: http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth This all went…
Lennard Fonteijn
  • 2,561
  • 2
  • 24
  • 39
6
votes
6 answers

CS193P Assignment 3, Hint#5 - What is the model?

I am working my way through the Stanford Fall 2011 iOS course: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/ I am onto assignment#3: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/assignments/Assignment%203_2.pdf As a…
Khaled Barazi
  • 8,681
  • 6
  • 42
  • 62
6
votes
1 answer

How to avoid coupling the View and the Controller in Swing

I have recently come across a problem trying to implement Model-View-Controller in Swing. I have a GUI class which consists of sub-panels, and those sub-panels consist of other sub-panels. Now in one of these sub-sub panels there is a JButton. In…
6
votes
2 answers

MVC in Vanilla JavaScript

I'm at the point now where i really want to organize my code in a way that makes it more scalable and manageable. i want to get a better understanding of the MVC architectural in javascript without using a framework. So this is what i understand…
zero
  • 2,999
  • 9
  • 42
  • 67
6
votes
2 answers

Communication between Model and Controller - iOS

I am new to iOS development, so I would appreciate some feedback. I am trying to build an iOS client for my web service. So far this is what I have done: I am implementing two views (Utility-based app using Storyboard). In the main view, I use a…
BlueChips23
  • 1,861
  • 5
  • 34
  • 53