Object Oriented Analysis and Design 1 Chapter 8 - Web Application System Design  Modeling Web Application using UML  Application Server  Web Application.

Slides:



Advertisements
Similar presentations
11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Advertisements

J2EE Architecture Overview
An architecture for webb applications, J2EE
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
1 Copyright 2002 © Paulo Merson J2EE – Building Component-based Enterprise Web Applications 05/09/2002 Paulo Merson.
Point Of Sale(POS) J2EE Application Department : Computer Science Degree : Master Student : Woojin Choi ID : (POS J2EE Application with JRun)
1 CS 483 Enterprise and Web Application Programming Week 6 Session Beans JSP Tutorial.
J2EE vs..NET Nigam Patel. Topics Background –Web Services, J2EE and.NET Similarities Differences Conclusion –Pros and Con (J2EE and.NET)
Introduction to Servlet & JSP
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Servlet and JSP Programming: An Introduction Spiros Papadimitriou
Emmanuel Cecchet et al.  Performance Scalability of J2EE application servers.  Test effect of: ◦ Application Implementation Methods ◦ Container Design.
Introduction Servlets and JSP Celsina Bignoli
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
EJB Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
1 Session Bean Chuyên đề Lập trình Java & J2EE Chương 14 Biên soạn: Th.S Nguyễn văn Lành.
1 J2EE. 2 Agenda 1. Application servers 2. What is J2EE?  Main component types  Application Scenarios  J2EE APIs and Services 3. EJB – a closer look.
J2EE Part 2: Enterprise JavaBeans CSCI 4300 Images and code samples from jGuru EJB tutorial,
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Seminar: Enterprise JavaBeans. Agenda Agenda Java™ 2 Platform Java™ 2 Platform Java™ 2 Platform,Enterprise Edition(J2EE) Java™ 2 Platform,Enterprise Edition(J2EE)
CS 493/693: Distributed Systems Programming V. “Juggy” Jagannathan CSEE, West Virginia University March 21, 2005.
Objectives Java Servlet Web Components
Chapter 5 Java Servlets. Objectives Explain the nature of a servlet and its operation Use the appropriate servlet methods in a web application Code the.
Enterprise JavaBeans Umer Farooq CS6704: Design Patterns & Component FrameworksFebruary 25, 2002.
1 Stateful Session Beans Stateless Session Beans Michael Brockway Sajjad Shami Northumbria University School of Computing, Engineering & Information Sciences.
Distributed Systems 1 Master of Information System Management Distributed Systems Persistence.
Chapter 7 Java Server Pages. Objectives Explain how the separation of concerns principle applies to JSP Describe the operation and life-cycle of a JSP.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
Enterprise Java Bean Computer Networks Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
1 Introduction to J2EE CS : Software Design Winter /T13 Based on: Advanced Web Applications Development, cs © Eliezer Dekel, Sara.
J2EE Structure & Definitions Catie Welsh CSE 432
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Enterprise JavaBeans Understanding EJB Components Version 0.1 Kamal Wickramanayake
1 Session Beans and Business Logic Presented By: Sethu Ram Kettimuthu.
Introduction to Enterprise JavaBeans Topics In Systems Architecture Barry Herbold
Java Servlets and Java Server Pages Norman White Stern School of Business.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
© 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.
Enterprise JavaBeans Session Beans. Session beans are a type of Enterprise JavaBean component designed to implement business logic responsible for managing.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
©SoftMoore ConsultingSlide 1 Overview of Servlets and JavaServer Pages (JSP)
1 Distributed System using J2EE. 2 What is J2EE?  J2EE (Java2 Enterprise Edition) offers a suite of software specification to design, develop, assemble.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Enterprise Java Beans N.V.RAJASEKHAR REDDY. Definition of EJB EJBs are the components that are the set of classes and interfaces deployed within a container.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
How CGI and Java Servlets are Run By David Stein 14 November 2006.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
EJB Enterprise Java Beans JAVA Enterprise Edition
14 Copyright © 2004, Oracle. All rights reserved. Achieving State Management in the Business Tier.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Speaker Name Speaker Title Speaker Title Oracle Corporation Olivier Le Diouris Principal Product Manager Oracle Corporation Building Servlet and JSP Applications.
©NIIT Session Beans Lesson 1B/ Slide 1 of 37J2EE Server Components Objectives In this lesson, you will learn to: Describe the characteristics of session.
Introduction Servlets and JSP
Introduction to J2EE Architecture
MSIS 655 Advanced Business Applications Programming
Distributed System Using Java 2 Enterprise Edition (J2EE)
J2EE – Building Component-based Enterprise Web Applications
Understanding and Designing with EJB
Component-based Applications
Understanding and Designing with EJB
Enterprise Java Beans.
J2EE – Building Component-based Enterprise Web Applications
Presentation transcript:

Object Oriented Analysis and Design 1 Chapter 8 - Web Application System Design  Modeling Web Application using UML  Application Server  Web Application Design

Object Oriented Analysis and Design 2 Modeling Web Application using UML

Object Oriented Analysis and Design Modeling Web Application using UML  Modeling Web Pages  Modeling EJB

Object Oriented Analysis and Design 4 Modeling Web Pages  For web pages, the stereotypes indicate that the class is an abstraction of the logical behavior of a web page on either the client or the server. The two abstractions are related to each other with a directional relationship between the two. This association is stereotyped as «build», since it can be said that a server page builds a client page.

Object Oriented Analysis and Design 5 Modeling Web Pages

Object Oriented Analysis and Design 6 Modeling Web Pages

Object Oriented Analysis and Design 7 Modeling Web Pages

Object Oriented Analysis and Design 8 Modeling Web Pages

Object Oriented Analysis and Design 9 Modeling Web Pages

Object Oriented Analysis and Design 10 Modeling EJB  Modeling EJB as a subsystem  Two approach:  Standard UML-Java Mapping  Sun JSR UML/EJB Mapping

Object Oriented Analysis and Design 11 Modeling EJB as a subsystem

Object Oriented Analysis and Design 12 Modeling EJB as a subsystem ICustomerMgt => CustomerHome (home interface) Icustomer => Customer (remote interface) >Customer =>CustomerEJB (bean class) validateCustomer() => findUser() (in home interface)

Object Oriented Analysis and Design 13 Modeling EJB as a subsystem

Object Oriented Analysis and Design 14 Modeling EJB as a subsystem

Object Oriented Analysis and Design 15 Modeling EJB as a subsystem

Object Oriented Analysis and Design 16 Modeling EJB as a subsystem

Object Oriented Analysis and Design 17 Standard UML-Java Mapping

Object Oriented Analysis and Design 18 Sun JSR UML/EJB Mapping

Object Oriented Analysis and Design 19 Application Server

Object Oriented Analysis and Design Application Server  Application Servers  J2EE Application Servers  Web Server and Application Server

Object Oriented Analysis and Design 21 Application Servers  In the beginning, there was darkness and cold. Then, … Centralized, non-distributed terminals mainframe terminals

Object Oriented Analysis and Design 22 Application Servers  The In the 90' s, systems should be client- server

Object Oriented Analysis and Design 23 Application Servers  Today, enterprise applications use the multi-tier model

Object Oriented Analysis and Design 24 Application Servers  " The Multi- tier applications" have several independent components  An application server provides the infrastructure and services to run such applications

Object Oriented Analysis and Design 25 Application Servers  Application server products can be separated into 3 categories:  J2EE-based solutions  Non-J2EE solutions (PHP, ColdFusion, Perl, etc.)  And the Microsoft solution (ASP/COM and now.NET with ASP.NET, VB.NET, C#, etc.)

Object Oriented Analysis and Design 26 J2EE Application Servers  Major J2EE products:  BEA WebLogic  IBM WebSphere  Sun iPlanet Application Server  Oracle 9iAS  HP/Bluestone Total-e-Server  Borland AppServer  Jboss (free open source)

Object Oriented Analysis and Design 27 Web Server and Application Server Web Server (HTTP Server) App Server 1 App Server 2 Internet Browser HTTP(S)

Object Oriented Analysis and Design 28 Web Application Design

Object Oriented Analysis and Design Web Application Design  Application Layer  Business Layer  J2EE Multi-tier Model  J2EE Application Scenarios  Main Technologies  Examples  Case Study –Online Bank

Object Oriented Analysis and Design 30 Application Layer

Object Oriented Analysis and Design 31 Business Layer

Object Oriented Analysis and Design 32 J2EE Multi-tier Model

Object Oriented Analysis and Design 33 J2EE Application Scenarios  Multi-tier typical application

Object Oriented Analysis and Design 34 J2EE Application Scenarios  Stand-alone client

Object Oriented Analysis and Design 35 J2EE Application Scenarios  Web-centric application

Object Oriented Analysis and Design 36 J2EE Application Scenarios  Business-to-business

Object Oriented Analysis and Design 37 Main technologies  JavaServer Pages (JSP)  Servlet  Enterprise JavaBeans (EJB)  JSPs, servlets and EJBs are application components

Object Oriented Analysis and Design 38 JSP  Used for web pages with dynamic content  Processes HTTP requests (non-blocking call-and- return)  Accepts HTML tags, special JSP tags, and scriptlets of Java code  Separates static content from presentation logic  Can be created by web designer using HTML tools

Object Oriented Analysis and Design 39 Servlet  Used for web pages with dynamic content  Processes HTTP requests (non-blocking call- and-return)  Written in Java; uses print statements to render HTML  Loaded into memory once and then called many times  Provides APIs for session management

Object Oriented Analysis and Design 40 EJB  EJBs are distributed components used to implement business logic (no UI)  Developer concentrates on business logic  Availability, scalability, security, interoperability and integrability handled by the J2EE server  Client of EJBs can be JSPs, servlets, other EJBs and external aplications  Clients see interfaces

Object Oriented Analysis and Design 41 EJB – The Big Picture

Object Oriented Analysis and Design 42 EJB at runtime Client can be local or remote

Object Oriented Analysis and Design 43 EJB at runtime

Object Oriented Analysis and Design 44 Types of EJB

Object Oriented Analysis and Design 45 Session Bean  Stateful session bean:  Retains conversational state (data) on behalf of an individual client  If state changed during this invocation, the same state will be available upon the following invocation  Example: shopping cart

Object Oriented Analysis and Design 46 Session Bean  Stateless session bean:  Contains no user-specific data  Business process that provides a generic service  Container can pool stateless beans  Example: shopping catalog

Object Oriented Analysis and Design 47 Entity Bean  Represents business data stored in a database ? persistent object  Underlying data is normally one row of a table  A primary key uniquely identifies each bean instance  Allows shared access from multiple clients  The Can live past the duration of client' s session  Example: shopping order

Object Oriented Analysis and Design 48 Entity Bean  Bean-managed persistence (BMP): bean developer writes JDBC code to access the database; allows better control for the developer  Container-managed persistence (CMP): container generates all JDBC code to access the database; developer has less code to write, but also less control

Object Oriented Analysis and Design 49 Message-Driven Bean  Message consumer for a JMS queue or topic  Benefits from EJB container services that are not available to standard JMS consumers  Has no home or remote interface  Example: Order processing – stock info

Object Oriented Analysis and Design 50 Examples  JSP example  Servlet example  EJB example

Object Oriented Analysis and Design 51 JSP example

Object Oriented Analysis and Design 52 JSP example Hello, User My name is Duke. What's yours?

Object Oriented Analysis and Design 53 JSP example <% if (request.getParameter("username") != null) { %> <% } %>

Object Oriented Analysis and Design 54 Servlet example public class HelloWorldServlet extends HttpServlet { public void service(HttpServletRequest req, HttpServletResponse res) throws IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println(" Hello World Servlet "); out.println(" Hello World! "); }

Object Oriented Analysis and Design 55 EJB Example // Shopping Cart example // Home interface public interface CartHome extends EJBHome { Cart create(String person) throws RemoteException, CreateException; Cart create(String person, String id) throws RemoteException, CreateException; }

Object Oriented Analysis and Design 56 EJB Example // Remote interface public interface Cart extends EJBObject { public void addBook(String title) throws RemoteException; public void removeBook(String title) throws BookException, RemoteException; public Vector getContents() throws RemoteException; }

Object Oriented Analysis and Design 57 EJB Example // Enterprise bean class public class CartEJB implements SessionBean { String customerName, customerId; Vector contents; private SessionContext sc; public void ejbCreate(String person) throws CreateException { if (person == null) { throw new CreateException("Null person not allowed."); } else { customerName = person; } customerId = "0"; contents = new Vector(); }

Object Oriented Analysis and Design 58 EJB Example public void ejbCreate(String person, String id) throws CreateException { if (person == null) { throw new CreateException("Null person not allowed."); } else { customerName = person; } IdVerifier idChecker = new IdVerifier(); if (idChecker.validate(id)) { customerId = id; } else { throw new CreateException("Invalid id: " + id); } contents = new Vector(); }

Object Oriented Analysis and Design 59 EJB Example public void addBook(String title) { contents. addElement(title); } public void removeBook(String title) throws BookException { boolean result = contents.removeElement(title); if (result == false) { throw new BookException(title + " not in cart."); } public Vector getContents() { return contents; }... }

Object Oriented Analysis and Design 60 EJB Example // EJB client (stand-alone application) public class CartClient { public static void main(String[] args) { try { CartHome home = (CartHome)initial.lookup("MyCart"); Cart shoppingCart = home.create("Duke DeEarl", "123"); shoppingCart.addBook("The Martian Chronicles"); shoppingCart.addBook("2001 A Space Odyssey"); shoppingCart.remove(); } catch (BookException ex) { System.err.println("Caught a BookException: " + ex.getMessage()); } catch (Exception ex) { System.err.println("Caught an unexpected exception!"); }

Object Oriented Analysis and Design 61 Case Study – Online Bank

Object Oriented Analysis and Design 62 Case Study – Online Bank

Object Oriented Analysis and Design 63 Case Study – Online Bank

Object Oriented Analysis and Design 64 Case Study – Online Bank

Object Oriented Analysis and Design 65 Case Study – Online Bank

Object Oriented Analysis and Design 66 Case Study – Online Bank

Object Oriented Analysis and Design 67 Case Study – Online Bank

Object Oriented Analysis and Design 68 Case Study – Online Bank

Object Oriented Analysis and Design 69 Case Study – Online Bank

Object Oriented Analysis and Design 70 Case Study – Online Bank

Object Oriented Analysis and Design 71 Case Study – Online Bank

Object Oriented Analysis and Design 72 Case Study – Online Bank

Object Oriented Analysis and Design 73 Case Study – Online Bank