Designing Web Applications. client server architectures design patterns model 2 web applications.

Slides:



Advertisements
Similar presentations
M-V-C for web applications. Model for Web Applications model consists of data and system state database tables –persistent data session information –current.
Advertisements

M-V-C for web applications. Model for Web Applications model consists of data and system state database tables –persistent data session information –current.
Welcome to Middleware Joseph Amrithraj
ICS 434 Advanced Database Systems
Database Architectures and the Web
Chapters 14 & 15 Internet Databases. E-Commerce  Bringing new products, services, or ideas to market, supporting and enhancing business operations 
DT228/3 Web Development WWW and Client server model.
Introduction to Model-View-Controller (MVC) Web Programming with TurboGears Leif Oppermann,
Muhammad Taimoor Khan
Computer Monitoring System for EE Faculty By Yaroslav Ross And Denis Zakrevsky Supervisor: Viktor Kulikov.
Technical Architectures
1 Chapter 12 Working With Access 2000 on the Internet.
Lecture 2 Web application architecture. Themes Architecture : The large scale structure of a system, especially a computer system Design choice: The need.
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
12 Chapter 12 Client/Server Systems Hachim Haddouti.
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.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Charlie Crocker Vice President Farallon Geographics, Inc. An Overview of Internet Mapping Technology.
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
UNIT-V The MVC architecture and Struts Framework.
Client/Server Architectures
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 13 Slide 1 Application architectures.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Databases and the Internet. Lecture Objectives Databases and the Internet Characteristics and Benefits of Internet Server-Side vs. Client-Side Special.
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.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Advanced Web Forms with Databases Programming Right from the Start with Visual Basic.NET 1/e 13.
Introduction to Internet Programming (Web Based Application)
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
E-Learning Material Web Application Design 3. Web Application Design Architecture Which objects go where? The final model notation Summary.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Csi315csi315 Client/Server Models. Client/Server Environment LAN or WAN Server Data Berson, Fig 1.4, p.8 clients network.
Unit – I CLIENT / SERVER ARCHITECTURE. Unit Structure  Evolution of Client/Server Architecture  Client/Server Model  Characteristics of Client/Server.
Implementation - Part 2 CPS 181s March 18, Pieces of the Site-building Puzzle Page 180, figure 4.1.
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
Project Overview Graduate Selection Process Project Goal Automate the Selection Process.
Project Overview Graduate Selection Process Project Goal Automate the Selection Process.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
Web application architecture1 Based on Jim Conallen: Web Applications with UML.
14 1 Chapter 14 Web Database Development Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Introduction to Model-View-Controller (MVC) Web Programming with TurboGears Leif Oppermann,
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Web-based Software Development - An introduction
Web Development Web Servers.
#01 Client/Server Computing
Lecture 1: Multi-tier Architecture Overview
Web Application Architectures
Introduction to Servlets
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Web Application Architectures
Database Connectivity and Web Development
Architecture of the web
Web Application Architectures
Web Servers (IIS and Apache)
Web Application Development Using PHP
#01 Client/Server Computing
Presentation transcript:

Designing Web Applications

client server architectures design patterns model 2 web applications

client-server systems network of machines, each designated as a client or server not exclusive to intranet systems –but large web sites now the main examples –account here is web and eCommerce-biased different levels of complexity exist –related to more sophisticated functionality peer-to-peer network –any machine has client and server roles

client-server systems client –active (master) –sends requests –awaits response server –passive (slave) –waits for requests –serves requests and sends a response

thin client vs fat client thin client –function is mainly presentational e.g. standard browser functionality –all significant processing done by server –client-server communication is frequent fat client –significant processing on client –e.g. Java applet, Flash, JavaScript –less communication required, less server load

2-tier client-server architecture client (browser) –http request –mainly for presentation of information –serving mainly static (D)HTML pages server (simple web server) –http response –web-server processing http –perhaps SSI, simple CGI –earliest and low-end web-sites

3-tier client-server architecture 3 rd tier is a database layer –data persists beyond request and response server layer –expanded functionality database connectivity user authentication and sessions perhaps multi-threading client layer (web browser) –forms interface to interact with data

a typical 3-tier architecture database/ file system web server and programs web browser presentation tierlogic tierdata tier

multi-tier architecture additional business logic layer(s) middleware –preprocessing and error handling –sophisticated transaction management multiple middle-ware servers –server farms linking to database layer web layer –standard web server JSP/Servelets | ASP.NET | ColdFusion |PHP

web applications Applications delivered over the web! Many server side components –N-tier architecture Very wide range of functionality –web mail –online retail sales and auction sites –wikis, discussion boards, weblogs –multi-player online role-playing games, etc…

software components of a web app web server –configuration files general processor components –e.g. PHP, ASP processor, XSLT processor application-specific software –servelets –scripts

data components of a web app databases –possibly distributed or mirrored session information –stateful servers retain session information –may persist in a database global information –shared by all or many web app processes –e.g. number of hits on the site, user profiles

file components of a web app web pages –html files, stylesheets –script files, applets –images dynamically generated pages –templates, e.g. PHP, ASP pages –xml files web app architecture –structure definition and global data files

design problems construction and testing –how do we build a web application? –what technology should we choose? re-use –can we use standard components? scalability –how will our web application cope with large numbers of requests? large volumes of data exchanged?

design problems security –how do we protect against attack? viruses malicious data access denial of service –different data views user types individual accounts data protection

design patterns a design pattern is a general solution to a common software design problem provides a development template OO design patterns: –relationships and interactions between objects not a finished design –the pattern must be adapted to the application –cannot simply translate into code

design patterns originally developed for architecture –Christopher Alexander ideas were adapted to OO Design –Beck and Cunningham, 1987 –Design Patterns: elements of Re-useable Object-oriented software, 1994 Reprinted and analysed many times now widely-used in software engineering

The Model-View-Controller Pattern very widely used pattern allows separation of development effort model –contains data and system state view –presents data and system state controller –handles events affecting model or view

model-view-controller model knows little about the view –simply signals changes (alerts listeners) view understands the model interface –uses model methods to get update data controller knows model and view interfaces –updates model in response to events –updates view in response to events or changes in the model

model-view-controller model viewcontroller event event is passed to the controller controller updates model and/or view view queries model model signals changes

example design and build a computer Monopoly game model –??? view –??? controller –???

Monopoly model game state –board data properties cards (chance and community chest) –player data money and properties owned, token, location –rules pay rent build houses and hotels Go to Jail

Monopoly View Representation of game state Various views possible Simple text –List of players, positions, properties owned,… Graphic presentation –Image of Monopoly Board –Visual positioning of players –Visualisation of money, properties owned,…

Monopoly view

Monopoly controller start game select next player player move end player turn player bankrupt? N end game game won? Y Y N remove player updates to model and view

advantages of M-V-C clarity of design –model methods give an API for data and state –eases the design of view and controller efficient modularity –any of the components can be easily replaced multiple views –many views can be developed as appropriate –each uses the same API for the model

advantages of M-V-C easier to construct and maintain –simple (text-based) views while constructing –more views and controllers can be added –stable interfaces ease development distributable –natural fit with a distributed environment powerful user interfaces –controller supports macro-like interaction with the model API

developing a M-V-C app build the model –public methods become the interface for views and controller –build simple views to test the model build the view(s) –use simple controllers to test view and model build the controller –implement handling of all events maintain –model remains fairly stable, views and controller may become more elaborate

M-V-C for web applications

Model for Web Applications model consists of data and system state database tables –persistent data session information –current system state data business logic (eCommerce) –rules governing the transaction

View for web applications view gives a presentation of the model client-side presentation in a browser window –(D)HTML –CSS stylesheets –server-side templates administrative information –server output logs

Controller for web applications controller handles events user-generated events –client-side scripting –http request processing –redirection –preprocessing system maintenance –web application management

M-V-C Example PHP /CGI Web Server Web Browser presentationrequest processingprogram logic controllerviewmodel two-tier client-server architecture

M-V-C Example JSP /ASP /CF Web Server Web Browser entity database view controller view/ controller model multi-tier client server architecture

development of absence monitoring web app model data –student ids and names –number of absences model API –list names –list names and absences –update absences implement as a relational database

development of absence monitoring web app views –attendance register –list of absences –add a student –delete a student implemented in a browser –DHTML interface –pages dynamically generated from model

development of absence monitoring web app controller –handle requests for views generate correct page from the database –update the model translate user action into a database update –update the views refresh browser when view changes

build the model design data structure implement tables create SQL queries –support all required functionality test queries against sample data –this is a simple view

build the view develop server side scripts to query the database –SQL already tested is the model API design web pages and embed the scripts –view now updates from the model

build the controller add client side scripts –JavaScript –HTML forms –input validation add navigation functionality –frames –layers update confirmation pages

web application frameworks

technologies designed to implement web apps in M-V-C –model 2 architecture provide standard re-useable components for model, view and controller greatly ease the design of large sophisticated web apps significant learning curve

web application frameworks typically xml configuration files glue components into an application implement standard web concepts –interface features (forms) –request and response objects –sessions –database interactions many frameworks exist

web application frameworks Many frameworks are being developed… –JavaServer Faces, Struts, Webwork2 –WebObjects (.NET specific) –Model Glue (ColdFusion specific) –Velocity, Fusebox, Mach II, Maypole, Catalyst, Tapestry, ZNF, Phrame, Cocoon, Ruby on Rails, … Most, but not all, are based around M-V-C