tags:

views:

253

answers:

1

What do you say? Any good or bad experience in your projects?

A: 

Model–View–Controller (MVC) is a software architecture[1], currently considered as an architectural pattern used in software engineering. The pattern isolates "domain logic" (the application logic for the user) from input and presentation (GUI), permitting independent development, testing and maintenance of each.

http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

Model-view-presenter is a software pattern, considered a derivative of the model-view-controller pattern.

http://en.wikipedia.org/wiki/Model-view-presenter

So,

MVC is a design pattern. A design pattern is a code structure that allows for common coding frameworks to be replicated quickly. You might think of a design pattern as a skeleton or framework on which your application will be built. The most obvious benefit of a MVC framework is that it helps you separate the business logic (database) and the presentation logic (design).

Basically:

  1. Models contain any and all code that relates to your database and other data structures. If you had a table called pages, you'd have a model for it and functions within that for selecting, creating, updating, and deleting records from that table, among other things.

  2. Views contain all your display and UI elements, your JavaScript code, Cascading Style Sheets (CSS), HTML, and even PHP.

  3. Controllers hold it all together. Each function in a controller represents a destination or route. If you had a destination called /about, your controller would have a function called about(). Basically, a controller decides which model and which view to run. It is a contract between views and models.

Sarfraz
these are definitions, not opinions about (that is what is being asked)
Tom Brito