Model View Controller

  • 807 views
Uploaded on

 

More in: Business , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
807
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
56
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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