1 / 10

Introduction to Model-View-Controller (MVC) in Web Programming

Delve into the world of web programming with this detailed lecture covering MVC architecture, web application structures, and the benefits of decoupling data and presentation. Learn about the Model-View-Controller pattern and its role in simplifying web application development.

boozer
Download Presentation

Introduction to Model-View-Controller (MVC) in Web Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Model-View-Controller (MVC) Web ProgrammingMukhtar Hakaale, 03.09.2018

  2. xhtml x2 css javascript dom, dynamic html java applets cgi/perl php x2 web usability x2 xml x2 Seems incredible complicated, already But still not everything (by far not!) How to possibly get it all under one hood? What did you like? WPS - your story so far

  3. Course of this lecture • What is web programming? • What is model-view-controller?

  4. Webapps summary • Accessed with a Web Browser (client) • Over a network • Code is mainly run on server • Exception: Javascript (also: Java, Flash,..) • Code is loaded from server • Data is mainly stored on server • Webapps can be updated easily… ..without updating the clients!

  5. General 3 tiered structure • First tier: client side code (web-browser), e.g. (X)HTML, Javascript, Java, Flash • Second tier: server side code, e.g. C/C++, Perl, PHP, Java, Ruby, Python • Third tier: server side database

  6. 2. Model View Controller • Architectural Pattern from Smalltalk (1979) • Decouples data and presentation • Eases the development

  7. Server Client • First thought (ok, but not far enough): • Tier 1: View (Client) • Tier 2: Controller (Server) • Tier 3: Model (Database) Database

  8. Presentation: • View is the user interface (e.g. button) • Controller is the code (e.g. callback for button) • Data: • Model is the database Presentation Data Database

  9. Example Control Flow in MVC • User interacts with the VIEW UI • CONTROLLER handles the user input (often a callback function attached to UI elements) • CONTROLLER updates the MODEL • VIEW uses MODEL to generate new UI • UI waits for user interaction

  10. Summary • Web applications • Client, Server, Database • Easy to maintain, harder to write • Model – View – Controller • Eases web application development

More Related