Introduction to Model-View-Controller (MVC) Web Programming with TurboGears Leif Oppermann, 24.04.2008.

Slides:



Advertisements
Similar presentations
1 CGICGI Common Gateway Interface Server-side Programming Lecture.
Advertisements

HTTP Request/Response Process 1.Enter URL ( in your browser’s address bar. 2.Your browser uses DNS to look up IP address of server.com.
Web Applications Development Using Coldbox Platform Eddie Johnston.
Server-Side vs. Client-Side Scripting Languages
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
What is it? –Large Web sites that support commercial use cannot be written by hand What you’re going to learn –How a Web server and a database can be used.
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
Cloud Computing Lecture #7 Introduction to Ajax Jimmy Lin The iSchool University of Maryland Wednesday, October 15, 2008 This work is licensed under a.
Multiple Tiers in Action
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
CS 290C: Formal Models for Web Software Lecture 1: Introduction Instructor: Tevfik Bultan.
Implementation of One Stop Search by XSLT By Dave Low University of Hong Kong 9-Dec-2003.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Software Architecture Patterns (2). what is architecture? (recap) o an overall blueprint/model describing the structures and properties of a "system"
Russell Taylor Lecturer in Computing & Business Studies.
Introduction to Web Applications Instructor: Enoch E. Damson.
E-Commerce The technical side. LAMP Linux Linux Apache Apache MySQL MySQL PHP PHP All Open Source and free packages. Can be installed and run on most.
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
Web Programming Language Dr. Ken Cosh Week 1 (Introduction)
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
UNIT-V The MVC architecture and Struts Framework.
Client/Server Architectures
ITM352 PHP and Dynamic Web Pages: Server Side Processing.
Web Applications Harry R. Erwin, PhD University of Sunderland CIT304/CSE301.
AJAX Chat Analysis and Design Rui Zhao CS SPG UCCS.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Rich Internet Applications for the Enterprise Creating RIA from your Oracle database using TURBO Enterprise Web 2.0 Presented By: John Krahulec Bizwhazee.
Introduction to Internet Programming (Web Based Application)
M1G Introduction to Database Development 6. Building Applications.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
20-753: Fundamentals of Web Programming 1 Lecture 1: Introduction Fundamentals of Web Programming Lecture 1: Introduction.
Web Interfaces, Forms & Databases Databases Snyder p HTML Basics Snyder p JavaScript Snyder Chapter 18.
Web Applications BIS4430 – unit 8. Learning Objectives Explain the uses of web application frameworks Relate the client-side, server-side architecture.
Architecture of the web Client Server retrieved or generated web page.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
SE-02 COMPONENTS – WHY? Object-oriented source-level re-use of code requires same source code language. Object-oriented source-level re-use may require.
Case Study Dynamic Website - Three Tier Architecture
INTRODUCTION TO WEB APPLICATION Chapter 1. In this chapter, you will learn about:  The evolution of the Internet  The beginning of the World Wide Web,
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
Rich Web Applications for the Enterprise... Creating RWA from Your Oracle Database Presented By: John Krahulec Bizwhazee SEOUC Charlotte February 2009.
Web Technologies Lecture 8 Server side web. Client Side vs. Server Side Web Client-side code executes on the end-user's computer, usually within a web.
Ajax VS Flex A comparison based on shopping cart implementation PoHsu Yeh py2157.
Web-Applications: TurboGears BCHB Lecture 25 12/02/2015BCHB Edwards.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Introduction to Model-View-Controller (MVC) Web Programming with TurboGears Leif Oppermann,
Basics Components of Web Design & Development Basics, Components, Design and Development.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
CX Introduction to Web Programming
Introduction to Internet Programming (Web Based Application)
Web Programming Language
Scripting - Client-side vs. Server-side Scripting
Web Technologies Computing Science Thompson Rivers University
JavaScript and Ajax (Ajax Tutorial)
Working with Client-Side Scripting
MVC and other n-tier Architectures
Database Driven Websites
Lecture 1: Multi-tier Architecture Overview
Web Application Architectures
Please thank our sponsors!
Web Application Architectures
WPS - your story so far Seems incredible complicated, already
…and web frameworks in general
COMPONENTS – WHY? Object-oriented source-level re-use of code requires same source code language. Object-oriented source-level re-use may require understanding.
Architecture of the web
Web Technologies Computing Science Thompson Rivers University
UFCEUS-20-2 Web Programming
Web Application Development Using PHP
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

Introduction to Model-View-Controller (MVC) Web Programming with TurboGears Leif Oppermann,

WPS - your story so far –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?

Course of this lecture What is web programming? What is model-view-controller? Introducing TurboGears

1. Web programming The non-design bits Developing web applications of all scales “In software engineering, a Web application or webapp is an application that is accessed with a Web browser over a network such as the Internet or an intranet. Web applications are popular due to the ubiquity of the browser as a client, sometimes called a thin client. The ability to update and maintain Web applications without distributing and installing software on potentially thousands of client computers is a key reason for their popularity. Web applications are used to implement Webmail, online retail sales, online auctions, wikis, discussion boards, Weblogs, MMORPGs, and many other functions.” – Wikipedia.org

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!

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

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

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

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

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

MVC – general example

3. Introduction to TurboGears JavaScript Library XHTML template engine Easy to use Python webserver ORM Database Interface (e.g. for MySQL, SQLite, etc.) VIEW CONTROLLER MODEL

> tg-admin quickstart NewDemo Enter package name [newdemo]: Do you need Identity (usernames/passwords) in this project? [no] [lots of output] > cd NewDemo >./start-newdemo.py 3. Introduction to TurboGears

Let‘s get started by watching a video (20 Minutes Wiki)

So what was that? Created skeleton files with startup script Defined Data-Model –created database tables from model –created seeding data in toolbox webapp Wrote View template in XHTML Wrote Controller code in Python –Index, edit, save At this point he had a working system –Several iterations to add all features Finally wrote AJAX code (Javascript) in template

Benefits Local development –No need to upload to server Quick turn around times –No need to compile –As CherryPy watches the file-system and reloads when sources are changed Database query and update was easy –No need to hand-write SQL –But could be done, if necessary

Summary Web applications –Client, Server, Database –Easy to maintain, harder to write Model – View – Controller –Eases web application development TurboGears –MVC WebApp Framework written in Python –

Thanks for your attention Next lecture: 1 PM today More on TurboGears (example project) –Movie Collection tool Questions / Comments: –Now –or