SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

4 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: Servlets.
CGI programming. Common Gateway Interface interface between web server and other programs (cgi scripts) information passed as environment variables passed.
Servlets, JSP and JavaBeans Joshua Scotton.  Getting Started  Servlets  JSP  JavaBeans  MVC  Conclusion.
Apache Tomcat as a container for Servlets and JSP
Java Server Pages (JSP)
 2002 Prentice Hall. All rights reserved. Chapter 9: Servlets Outline 9.1 Introduction 9.2 Servlet Overview and Architecture Interface Servlet and.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
JSP Java Server Pages Reference:
GRASP : Designing Objects with Responsibilities
Comp2513 Java Servlet Basics Daniel L. Silver, Ph.D.
SE-2840 Dr. Mark L. Hornick1 Java Servlet-based web apps Servlet Architecture.
Java Servlets and JSP.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Servlets. - Java technology for Common Gateway Interface (CGI) programming. - It is a Java class that dynamically extends the function of a web server.
Java support for WWW Babak Esfandiari (sources: Qusay Mahmoud, Roger Impey, textbook)
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
CMPUT 391 – Database Management Systems Department of Computing Science University of Alberta CMPUT 391 Database Management Systems Web based Applications,
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
1 Another group of Patterns Architectural Patterns.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Java Servlets & Java Server Pages Lecture July 2013.
Java Servlets Lec 27. Creating a Simple Web Application in Tomcat.
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
What to remember from Chap 13 (Logical architecture)
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
S ERVLETS Hits Counter 21-Nov-15. S ERVLETS - H ITS C OUNTER Many times you would be interested in knowing total number of hits on a particular page of.
Servlets Part 3. Topics Session Tracking ServletToServletCommunication-Servlet Chaining ServerSideIncludes AppletToServlet.
JavaServer Page by Antonio Ko. Overview ► Introduction ► What is a servlet? ► What can servlets do? ► Servlets Vs JSP ► Syntax ► Samples ► JavaBean ►
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
The Template Method Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
SEA Side – Extreme Programming 1 SEA Side Software Engineering Annotations Architectural Patterns Professor Sara Stoecklin Director of Software Engineering-
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 21 Java Servlets Wed. 11/22/00 based on material.
Chapter 17 Designing with Responsibilities. Fig
How CGI and Java Servlets are Run By David Stein 14 November 2006.
 Java Server Pages (JSP) By Offir Golan. What is JSP?  A technology that allows for the creation of dynamically generated web pages based on HTML, XML,
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
CS122B: Projects in Databases and Web Applications Spring 2017
Introduction to Servlets
CS122B: Projects in Databases and Web Applications Winter 2017
Servlet Fudamentals.
Java Servlets By: Tejashri Udavant..
Course Outcomes of Advanced Java Programming AJP (17625, C603)
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
GRASP : Designing Objects with Responsibilities
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
CS122B: Projects in Databases and Web Applications Winter 2018
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
Introduction to Servlets
CS122B: Projects in Databases and Web Applications Spring 2018
Objectives In this lesson you will learn about: Need for servlets
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
Java Servlets and JSP.
J2EE Lecture 1:Servlet and JSP
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
CS122B: Projects in Databases and Web Applications Winter 2019
Introduction to Servlet
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
Presentation transcript:

SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler

Week 6 Servlets and JSP Larman Controller Principle Fowler Front Controller –GoF Command pattern –Java reflection to instantiate Command

Servlets, The General Idea Applet as a client side Java application. Servlet as a server side technology for implementing part of the functionality of an application. HTTP (URL) requests cause a servlet to be: –Instantiated (if it did not exist). –Run. –The servlet builds a response which is then sent back to the client (usually in the form of HTML).

Servlet: HelloWeb public class HelloWebServlet extends HttpServlet { protected void doGet( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletOutputStream out = response.getOutputStream(); out.println("Hello Web!"); }

Java Server Page Servlet: –Embed HTML inside code. JSP –Embed code inside HTML.

HelloWeb.jsp page contentType="text/html; charset=iso " language="java"... %> Hello Web!

Hello.jsp page contentType="text/html; charset=iso " language="java"... %> Hello

Java Server Page Implemented as a (special kind of) servlet.

Controller Illustration: Web-based EA

PATTERN: Controller What object in the domain (or application coordination layer) receives requests for work from the UI layer?

PATTERN: Controller (Larman 17.13) Problem: What object in the domain (or application coordination layer) receives requests for work from the UI layer? System operations (see SSD): major input events to the system The controller is the first object beyond the UI layer that is responsible for receiving or handling a system operations message. Note that UI objects delegate system operation request to a controller.

PATTERN: Controller (Larman 17.13) Solution: Assign the responsibility to a class representing one of the following choices: A façade controller, which represents 1.the overall system 2.A root object 3.A device that the software is running within, or 4.A major subsystem A use case or session controller which represents a use case scenario in which the system operation occurs

Fig

Domain Data Source Transaction Script Domain Model Data Mapper Row Data Gateway Front Controller Template View Transform View Page Controller Presentation Active Record Fowler’s EA Patterns Table Module Table Data Gateway

Front Controller Fowler: A controller that handles all requests for a web site. The Front Controller consolidates all request handling by channeling requests through a single handler object. This object can carry out common behaviour which can be modified at runtime with decorators. This handler then dispatches to command objects for behaviour particular to a request.

Front Controller GoF design pattern: Command Use a Command object to encapsulate the steps that are executed by a command. Command::doIt() executes command Allows Command::unDoIt() etc GoF design pattern: Decorator Decorator::m() adds additional behaviour, but delegates to real Object::m() for real behaviour Eg, logging command execution before/after executing command

Page vs Front Controller – Differences in URL Page Controllers for A … Front Controller for A1 Base URL: …/frontController ?command=ViewTaskList …/frontController ?command=AddTaskGrade&title=abc&…

Front Controller

Front Controller: Sequence Diagram

Front Controller: ProcessRequest

Front Controller (cont’d)