Model View Controller
What is MVC <ul><li>Before we look at MVC we need a small history of Web Technologies and design patterns </li></ul><ul><l...
Design Pattern <ul><li>Adhoc (Write what you feel) </li></ul><ul><li>Event based design with various kinds of controllers ...
MVC Schematic View
Client and Dispatcher <ul><li>Client is Typically an Http 1.0 and above compliant client like a web browser </li></ul><ul>...
View <ul><li>HTML </li></ul><ul><li>XML </li></ul><ul><li>Javascript </li></ul><ul><li>etc </li></ul>
Controller and Actions <ul><li>http://localhost/controller/action/parameters </li></ul><ul><li>If something is going to hi...
Model <ul><li>This is nothing but your business layer.  </li></ul><ul><li>All your business logic is written here </li></u...
FAQ <ul><li>What code goes in Model and what in Controller? </li></ul><ul><li>Why is MVC a better design pattern </li></ul...
Active Records <ul><li>Convention over configuration </li></ul><ul><li>Why is this called Active records </li></ul><ul><li...
Upcoming SlideShare
Loading in …5
×

Model View Controller

942 views

Published on

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
942
On SlideShare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
59
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Model View Controller

  1. 1. Model View Controller
  2. 2. What is MVC <ul><li>Before we look at MVC we need a small history of Web Technologies and design patterns </li></ul><ul><li>CGI </li></ul><ul><li>ASP or php or jsp </li></ul><ul><li>Event based frameworks like ASP.NET java faces </li></ul>
  3. 3. Design Pattern <ul><li>Adhoc (Write what you feel) </li></ul><ul><li>Event based design with various kinds of controllers </li></ul><ul><li>Model View Controller </li></ul>
  4. 4. MVC Schematic View
  5. 5. Client and Dispatcher <ul><li>Client is Typically an Http 1.0 and above compliant client like a web browser </li></ul><ul><li>Dispatcher is typically a routing table which would dispatch a particular request to a particular controller </li></ul>
  6. 6. View <ul><li>HTML </li></ul><ul><li>XML </li></ul><ul><li>Javascript </li></ul><ul><li>etc </li></ul>
  7. 7. Controller and Actions <ul><li>http://localhost/controller/action/parameters </li></ul><ul><li>If something is going to hit your website it has to be through a controller and an action </li></ul><ul><li>Use base classes for specific controllers </li></ul><ul><li>Load helper components in controllers </li></ul><ul><li>Define actions of the same controller like </li></ul><ul><li>Controller – User :: Actions – add, edit, delete </li></ul>
  8. 8. Model <ul><li>This is nothing but your business layer. </li></ul><ul><li>All your business logic is written here </li></ul><ul><li>Eg: Send Email after registration </li></ul><ul><li>Eg: delete a relationship on delete of an entity </li></ul><ul><li>Etc </li></ul><ul><li>Heart of your application </li></ul>
  9. 9. FAQ <ul><li>What code goes in Model and what in Controller? </li></ul><ul><li>Why is MVC a better design pattern </li></ul><ul><li>Is View dumb? </li></ul><ul><li>Model sounds like just get set methods, why do you say it is the heart? </li></ul><ul><li>Are Controllers reusable? </li></ul><ul><li>How are models reusable? </li></ul>
  10. 10. Active Records <ul><li>Convention over configuration </li></ul><ul><li>Why is this called Active records </li></ul><ul><li>Easily defining relationships </li></ul><ul><li>Magic Methods </li></ul><ul><li>Drawbacks </li></ul>

×