Web Software Model CS 4640 Programming Languages for Web Applications

Slides:



Advertisements
Similar presentations
Lecture plan Information retrieval (from week 11)
Advertisements

Server-Side vs. Client-Side Scripting Languages
Multiple Tiers in Action
Dynamic Web Pages Bert Wachsmuth. Review  Internet, IP addresses, ports, client-server, http, smtp  HTML, XHTML, XML  Style Sheets, external, internal,
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
UNIT-V The MVC architecture and Struts Framework.
DHTML - Introduction Introduction to DHTML, the DOM, JS review.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Server-side Scripting Powering the webs favourite services.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Fundamentals of Database Chapter 7 Database Technologies.
Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.
DHTML - Introduction Chapter Introduction to DHTML, the DOM, JS review.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Java Server Pages Can web pages be created specially for each user?
J2EE Platform Overview (Application Architecture)
Building Enterprise Applications Using Visual Studio®
DHTML.
Web Programming Language
Web Technologies Computing Science Thompson Rivers University
Structure of a web application
Netscape Application Server
Web Development Web Servers.
Introduction and Principles
AJAX and REST.
Tutorial 6 Topic: jQuery and jQuery Mobile Li Xu
Web Software Model CS 4640 Programming Languages for Web Applications
AJAX.
Web Engineering.
Haritha Dasari Josue Balandrano Coronel -
AJAX.
PHP / MySQL Introduction
Dynamic Web Pages (Flash, JavaScript)
Design and Maintenance of Web Applications in J2EE
DHTML Javascript Internet Technology.
Oracle Sales Cloud Sales campaign
DHTML Javascript Internet Technology.
Lecture 1: Multi-tier Architecture Overview
CHAPTER 1 THE ABC OF PROGRAMMING
An Introduction to Software Architecture
Secure Web Programming
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Introduction to DHTML, the DOM, JS review
Back end Development CS Programming Languages for Web Applications
JavaScript CS 4640 Programming Languages for Web Applications
[Robert W. Sebesta, “Programming the World Wide Web
Web-Applications & AJAX
Architecture of the web
State Handling CS 4640 Programming Languages for Web Applications
Web Technologies Computing Science Thompson Rivers University
Web Client Side Technologies Raneem Qaddoura
[Robert W. Sebesta, “Programming the World Wide Web
Back end Development CS Programming Languages for Web Applications
State Handling CS 4640 Programming Languages for Web Applications
[Robert W. Sebesta, “Programming the World Wide Web
Web Application Development Using PHP
JavaScript: BOM and DOM CS Programming Languages for Web Applications
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

Web Software Model CS 4640 Programming Languages for Web Applications [Robert W. Sebesta, “Programming the World Wide Web” Upsorn Praphamontripong, “Web Mutation Testing”]

Web Applications User interactive software programs, deployed on a web server, accessed via a web browser Use enabling technologies to Make web site contents dynamic Allow users of the system to implement business logic on the server Let users affect state on the server Constructed from diverse, distributed, and dynamically generated web components Web components are software modules that implement different parts of the application’s functionality An enabling technology makes web pages interactive and responsive to user input

How do Web Apps fit in with the World Around Them? Object type: Hotel Object type: Car Object type: Car Object type: Car

Objects and Properties Object type: Hotel Properties Name: Awesome Rating: 5 Rooms: 70 Bookings: 56 Pool: true Gym: true Object type: Car Properties Make: UVA1 currentSpeed: 30mph Color: yellow Fuel: gasoline Object type: Car Properties Make: UVA2 currentSpeed: 20mph Color: red Fuel: gasoline Object type: Car Properties Make: UVA2 currentSpeed: 35mph Color: blue Fuel: gasoline

Objects and Events Object type: Hotel Object type: Car Event Happens when Reserve reservation is made Cancel reservation is cancelled Object type: Car Event Happens when Break: driver slows down Accelerate: driver speeds up Object type: Car Event Happens when Break: driver slows down Accelerate: driver speeds up Object type: Car Event Happens when Break: driver slows down Accelerate: driver speeds up

Objects and Methods Object type: Hotel Object type: Car Method What it does makeReservation() increases value of bookings property cancelReservation() decreases value of bookings property checkAvailability() subtracts value of bookings property from value of rooms property and returns number of rooms available Object type: Car Method What it does changeSpeed() increases or decreases value of currentSpeed property Object type: Car Method What it does changeSpeed() increases or decreases value of currentSpeed property Object type: Car Method What it does changeSpeed() increases or decreases value of currentSpeed property

All Together Object type: Hotel Object type: Car Event Happens when Method called Reserve reservation is made makeReservation() Cancel reservation is cancelled cancelReservation() Method What it does makeReservation() increases value of bookings property cancelReservation() decreases value of bookings property checkAvailability() subtracts value of bookings property from value of rooms property and returns number of rooms available Properties Name: Awesome Rating: 5 Rooms: 70 Bookings: 56 Pool: true Gym: true Object type: Car Event Happens when Method called Break driver slows down changeSpeed() Accelerate driver speeds up changeSpeed() Method What it does changeSpeed() increases or decreases value of currentSpeed property Properties Make: UVA1 currentSpeed: 30 Color: yellow Fuel: gasoline

Web Browsers and Objects Object type: Window Properties Location: http://www.cs.virginia.edu/~up3f/cs4640/syllabus.html Object type: Document Properties URL: http://www.cs.virginia.edu/~up3f/cs4640/syllabus.html lastModified: 06/01/2019 10:19:23 Title: CS4640: WebPL

BOM: Browser Object Model BOM – collection of objects that the browser makes available to us for use with JavaScript window Object form Object link Object image Object document Object … DOM location Object history Object document Object navigator Object screen Object … … form Object link Object image Object

DOM: Document Object Model Method What it does write() adds content to the document getElementById() accesses an element of a given id attribute Event Happens when Load page and content have finished loading Click user clicks the mouse over the page Keypress user presses down on a key Object type: Document Properties URL: http://www.cs.virginia.edu/~up3f/cs4640/syllabus.html lastModified: 06/01/2019 10:19:23 Title: CS4640: WebPL

How A Browser See A Web Page document <html> <head> <body> <meta> <title> <link> http-equiv content-type Content text/html ... CS4640: WebPL rel stylesheet href styles/cs4640-style.css ... <a> <header> name top <ul> class navbar ... <div> class container bottom ... <nav> href #top class btn role button ... <button> <h3> class main ... id contact Top class sidebar ... Contact Information The browser receives an HTML page It creates a model of the page and stores it in memory It shows the page on screen using a rendering engine

Server Side Processing data HTTP Request XAMPP Client UI implemented in a browser Server Web server Container engine Program components HTTP Response HTML

General Design Issues Separation of concerns: design goals of web app design Presentation Logic Data Seven criteria the design should support: Reliability Usability Security Availability (and also Accessibility) Scalability Maintainability Performance and Time to market

Separation of Concerns Presentation Logic Data Data content Data representation Data storage HTML, view Functions and classes, software Classes, objects Data structure, classes, objects Database and files, Oracle, SQL, NoSQL Assumptions about data Data values: contents of memory – change very frequently (during execution) Data presentation: how the data are presented – change occasionally Data structure: types, organization and relationships of different data elements, changes infrequently

Architectural Styles How to partition a system How components identify and communicate with each other How information is communicated How elements of a system can evolve Web architectural styles constantly change The goal is to separate logic from presentation and to separate as many concerns in the logic as possible

Multi-Tiered Architectures Each software layer only communicates with adjacent layers Algorithms Business Processing Presentation layer Business logic layer Data layer Data storage HTML, view Classes, objects Web-specific libraries Data Reading and Writing DB, XML, Data files Other software Communicates with users Most software is here Separate concerns Enables distribution

(Client requests are intercepted here) Page-centric Design Server Database Main component (Client requests are intercepted here) Component (data) Uses or instantiates Request Response Web client Requests are made to a main component and the main component response to clients – “client-server”

Dispatcher (N-tier) Design Server Dispatcher Business processing Usually use forward Request Response Web client Component presentation Component presentation Data Database Requests are sent to a dispatcher that then forward the requests to another component (using forward or redirect control connection)

Model View Controller An abstraction frequently used in web app design Provide a way to divide the responsibilities of objects Decreases coupling between objects and layers (supports easier maintenance) Help divide the work (supports development expertise areas)

Model View Controller (2) method calls events data structures HTML / JSP / PHP (view) / frontend Components Model Encapsulates application state Responds to state queries Exposes application functionality Notifies views of changes state change state query change notification View Controller view select Renders the model Requests updates from the model Sends user inputs to controller Allows controller to select view Defines application behavior Maps user actions to model updates Selects a view for response One view for each function user input [Graphic from Designing Enterprise Applications with the Java 2 Platform, Enterprise Edition, Nicholas Kassem et al., October 2000]

Server-Side Scripting JSP Generate HTML on the server through scripts Early approaches emphasized embedding server code inside HTML pages Examples: PHP, JSP PHP

Server-Side Scripting Site Browser Web server Database HTML HTTP request HTTP response HTML templates, server logic, load and store state to database Advantages Server-side processing, browser independent, search optimization improvement, increased security Disadvantages Poor modularity, hard to understand, difficult to maintain

Server-Side Framework Structure server into tiers, organizes logic into classes Execution on the server Can be single-page or multiple pages with page-centric design, dispatcher design, model-view-control design, or combination of any architectures Example: JSP (with separation of concerns) HTML and JSP Java classes (non-servlet) Servlets and beans Data structure, beans, Java classes Database and files, Oracle, SQL Presentation Logic Data Data content Data representation Data storage

Server-Side Framework Site Browser Web server Database HTML HTTP request HTTP response Presentation Logic Data Advantages Separation of concerns, maintain and reuse Disadvantages Need to load an entire page to get new data

Front End Frameworks Client is organized into separate components, capturing model of web application data Components separate logic from presentation Components dynamically generate corresponding code based on component state Example: Angular

Front End Framework Site Browser Web server Database Front end framework HTTP request HTTP response Presentation Logic Data Advantages Code organization, reuse, quick and easy to develop Disadvantages Duplicate logic in client and server

Single Page Application (SPA) Client-side logic sends messages to server, receives response Logic is associated with a single HTML page, written in JavaScript HTML elements dynamically added and removed through DOM manipulation Enabling technologies AJAX DOM Manipulation JSON Jquery Angular (include and routing are useful) Example: Gmail

Single Page Application Site Browser Web server Database HTML HTTP request HTTP response Presentation Logic Data JavaScript HTML elements event Advantages Fast (load most resources once; only data are transmitted) Disadvantages Hard to maintain and reuse, cross-site scripting, memory leak

Summary: Web Apps Deploy across the Web New technologies Other (software) deployment methods include bundling, shrink- wrapping, embedding, and contracting New technologies New conceptual language constructs for programming Integration Data management Control connections Browser features These differences affect every aspect of how to engineer high quality software