Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Web Applications

Similar presentations


Presentation on theme: "Introduction to Web Applications"— Presentation transcript:

1 Introduction to Web Applications
Jeff Offutt SWE 432 Design and Implementation of Software for the Web

2 Web Applications A web application uses enabling technologies to
make web site contents dynamic allow users of the system to implement business logic on the server Web applications let users affect state on the server A web application is a program deployed on the web An enabling technology makes web pages interactive and responsive to user input 21 September 2018 © Offutt

3 Web Application Failures
Web applications have many problems Oct 2004: Paypal waived transaction fees for an entire day because of a service outage after an upgrade Aug 2006 and July 2008: Amazon failure caused businesses to lose information and revenue Sep 2011: 2 hours downtime of Target’s web site and its 1 day intermittently functioning delayed and cancelled customers’ orders Mar 2012: The BodyShop BOGO turned into an extra discount Sep 2012: online attacks on Bank of America, JPMorgan Chase, Citigroup, US Bank, Wells Fargo, and PNC Oct 2013: Healthcare system failed on launch 21 September 2018 © Offutt

4 Traditional Computing Use
A user works with software on her computer 21 September 2018 © Offutt

5 Client – Server Computing
A user works with software or data on a separate computer called a server Client requests data Client PC Server returns data Compute or DB Server 21 September 2018 © Offutt

6 Web Applications Many users work with servers and databases that can be reached through the Internet with the HyperText Transfer Protocol SQL Records HTML HTTP Request Internet Client Browser Client Browser Client Browser 21 September 2018 © Offutt

7 N-Tier Web Architecture
Large web applications run on many computers that have to coordinate with each other. Amazon and Netflix have thousands of servers. middleware network middleware Client Web Servers Application Servers DB Servers Browser Javascripts HTML PHP ASP JSP, etc Java C# 21 September 2018 © Offutt

8 How the Software Works HTML Browser Browser Java Servlet—idProgram
<body> <form method=post action=idProgram Name=idForm> Name: <input type=text name=userName> Age: <input type=text name=age> <input type=text name= > </form> </body> </html> HTML Name : George Age : 23 Browser to server out.println (“<html>\n”); out.println (“<body>\n”); out.println (“<p>Your name is “); out.println (req.getParameter (userName)); out.println (“\n<p>Your age is “); out.println (req.getParameter (age)); out.println (“\n<p>Your is “); out.println (req.getParameter ( )); out.println (“</body>”); out.println (“</html>”); Java Servlet—idProgram Your name is George Your age is 23 Your is Browser to client 21 September 2018 © Offutt

9 Server Side Processing
HTTP Request data Web server UI implemented in a browser Container engine Program components Client Server HTML HTTP Response 21 September 2018 © Offutt

10 Execution Overview Server Container engine Program component
1 8 Incoming request on port 8080 Server Response back to requestor HTTP Request HTTP Response 7 2 Web server Request / Response Objects Modified Response Objects 6 3 Container engine Create thread / call method Return 5 Program component 4 21 September 2018 © Offutt

11 Web Software Container Engine
Web App 1 Web App 2 C2a C1a C2b C1b C2d C1c C2c Shared memory Shared memory Shared memory Web applications are constructed from diverse, distributed, and dynamically generated web components 21 September 2018 © Offutt

12 Session Management HTTP client-server communication is connnectionless
As soon as the request is made and fulfilled, the connection is terminated Communication is simple and resistant to network problems How can servers keep track of state of different clients? Session : A single coherent use of the system by the same user Example : shopping carts Cookies : A string of characters that a web server places on a browser’s client to keep track of a session Usually used as an index into a table (dictionary) on the server Most dictionaries expire after a period of time (15 to 30 minutes) We will come back to this later … 21 September 2018 © Offutt

13 Enabling Technologies – CGI
CGI : Common Gateway Interface allows clients to execute applications on the server The first enabling technology CGI applications usually reside in a special “safe” directory Can be written in any language; PERL was most common CGI apps typically : process data modify server state return information (usually an HTML page) 21 September 2018 © Offutt

14 Enabling Technologies Problems with CGI
Each and every execution of a CGI module requires a new process on the web server CGI posed some significant security risks CGI does not automatically provide session management services Perl is a difficult language in which to write large applications Solution : Plug-ins on the Web server 21 September 2018 © Offutt

15 Enabling Technologies Web Server Plug-ins
A plug-in is an extension to a web server that allows a different program to handle certain types of requests images, sound, video (first plug-ins) compiled module applications scripted page applications Plug-ins typically keep an active process as long as the web server is active 21 September 2018 © Offutt

16 Enabling Technologies - Plug-ins Compiled Modules
Compiled modules are executable program components that the server uses Common compiled module application plug-ins : Microsoft’s .NET ASP J2EE Java servlets Compiled modules are efficient and very effective They allow programmers to clearly separate the front- end from the back-end Aids design Complicates implementation 21 September 2018 © Offutt

17 Enabling Technologies - Plug-ins Scripted Pages
Scripted pages look like HTML pages that include code to process business logic Execution is on the server, not on the client unlike JavaScripts They have HTML with program statements that get and process data JSPs are compiled and run as servlets very clean and efficient PHP scripts are interpreted within the server 21 September 2018 © Offutt

18 Enabling Technologies - Plug-ins Scripted Pages
Common scripted pages: Adobe’s ColdFusion Microsoft’s Active Server Pages (ASP) PHP Java Server Pages (JSP) Scripted pages are generally easy to develop and deploy They mix logic with HTML, so can be difficult to read and maintain Not as effective for heavy-duty engineering 21 September 2018 © Offutt

19 Summary Web Programming
The major difference is deployment Software is deployed across the Web using HTTP Other deployment methods include bundling, shrink-wrapping, embedding, and contracting New software technologies New conceptual language constructs for programming Integration Data management Control connections These differences affect every aspect of how to engineer high quality software 21 September 2018 © Offutt

20 What We Will Study We will learn about these concepts in the context of several technologies PHP Ajax Servlets JSPs 21 September 2018 © Offutt


Download ppt "Introduction to Web Applications"

Similar presentations


Ads by Google