Copyright W. Howden1 Lecture 19: Intro to O/O Components.

Slides:



Advertisements
Similar presentations
12 Copyright © 2005, Oracle. All rights reserved. Implementing Business Tasks with Session EJBs.
Advertisements

11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
EJB Entity Beans. Entity Beans Data versus logic Used to represent an instance rather than a collection of data (depending on underlying storage) Represents.
Apache Struts Technology
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
Copyright W. Howden1 Lecture 3: Elaboration and System Architecture.
Servlets and a little bit of Web Services Russell Beale.
Overview of The Java Platform Solution for E-Business Applications : JSP, Servlet and EJB.
EJB Design. Server-side components Perform –complex algorithms –high volume transactions Run in –highly available environment (365 days/year) –fault tolerant.
Enterprise Java Beans Welcome to the world of “Distributed System” Presented By: Sameer Nanda Date: 12/17/03.
Application Server Lecture Paulo Barroso Kris Carver Todd Kitterman Eric Silva.
Java 2 – Enterprise Edition Kevin J. LaFata April 21, 2003 UM – St. Louis.
System Architecture Lecture 3 CSE 111 Spring /22/20151Copyright William E. Howden.
CS 483 Enterprise and Web Application Programming
UNIT-V The MVC architecture and Struts Framework.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
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.
EJB Fundamentals Celsina Bignoli
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
1 J2EE Components. 2 Application Servers relieve the programming burden for business distributed components. They provide support for system level services.
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.
J2EE Part 2: Enterprise JavaBeans CSCI 4300 Images and code samples from jGuru EJB tutorial,
Enterprise Java Beans - (EJB)
Jaeki Song ISQS6337 JAVA Lecture 16 Other Issues in Java.
Entity Beans BMP Celsina Bignoli
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
Container-Managed Persistence (CMP) Entity Beans Lesson 3A / Slide 1 of 42J2EE Server Components Objectives In this lesson, you will learn to: Identify.
Enterprise Java Beans Part II Kyungmin Cho 2001/04/13.
The Triad of Beans I Oleh: Dini Addiati ( ) Fahrurrozi Rahman ( Y) Irfan Hilmy ( ) Salman Azis A ( ) Aziiz Surahman.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Introduction to J2EE Architecture Portions by Kunal Mehta.
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.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
MACIASZEK, L.A. (2001): Requirements Analysis and System Design. Developing Information Systems with UML, Addison Wesley Chapter 6 - Tutorial Guided Tutorial.
Enterprise JavaBeans Understanding EJB Components Version 0.1 Kamal Wickramanayake
1 Java EE Programming Enterprise JavaBeans. 2 Topics J2EE Overview Enterprise JavaBeans Overview Enterprise Entity Beans Case Study How to build them.
Introduction to Enterprise JavaBeans Topics In Systems Architecture Barry Herbold
EJB Overview: Constraint Types and Enforcement in JBoss Elissa Newman Fluid Meeting 6/3/04.
Entity Beans & Persistence Chris Alexander CS 486 Spring 2001.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
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.
Session Beans Based on: Patel, Brose, Silverman, Mastering Enterprise JavaBeans 3.0.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
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.
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.
Copyright © 2002 ProsoftTraining. All rights reserved. Enterprise JavaBeans.
13 Copyright © 2004, Oracle. All rights reserved. Managing Persistent Data in the Business Tier Entity EJBs.
Enterprise JavaBeans: Fundamentals. EJB Fundamentals(c)CDAC(Formerly NCST)2 Contents Introduction Technology Overview EJB Architecture EJB Specification.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Middleware Technology (J2EE/EJB) EJB Fundamentals.
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
EJB Enterprise Java Beans JAVA Enterprise Edition
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
Apache Struts Technology A MVC Framework for Java Web Applications.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
©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 to J2EE Architecture
Introduction to Enterprise JavaBean
Understanding and Designing with EJB
Luca Simone Software Engineering 2 a.a. 2001/2002
Objectives In this lesson, you will learn to:
Understanding and Designing with EJB
Understanding and Designing with EJB
COMPONENTS – WHY? Object-oriented source-level re-use of code requires same source code language. Object-oriented source-level re-use may require understanding.
Enterprise Java Beans.
Knowledge Byte In this section, you will learn about:
Presentation transcript:

Copyright W. Howden1 Lecture 19: Intro to O/O Components

Copyright W. Howden2 O/O Components A computational unit that exposes a well defined, contractual interface –constructed from a set of one or more classes Sample components –Applets, Servlets, Java Beans, Enterprise Java Beans

Copyright W. Howden3 O/O World Dream Goal: objects everywhere To get something done, send a message to the appropriate kind of object Problems –how to find objects, how to communicate –sharing, persistency, load balancing, transactions

Copyright W. Howden4 Distributed O/O Objects – Simple Early Models RMI (Java), Corba, Com RMI –register remote objects with a public name –create stub and skeleton proxies that are network savvy Limited facilities for persistency, sharing, transactions, remote creation

Copyright W. Howden5 Bean Components Java Beans –“ A reusable software component based on the JB’s specification that can be manipulated visually in a builder tool.” Enterprise Java Beans –“A set of contracts between the component developer and the system that hosts the component.”

Copyright W. Howden6 Additional Component Aspects Deployable –loaded into a container in which they can run – linked together to build a system Runs in a “container” that supplies services need for running and managing the components Distributable, with remote invocation via a specified interface

Copyright W. Howden7 Servlet Components compiled Java classes with special methods run on a request/response oriented server –request (possibly with data) arrives at server –servlet is run to generate response that is returned Used for programming server side presentation logic, e.g. –servlet code constructs HTML specified page and returns it –results in a thin “client”, i.e. browser

Copyright W. Howden8 Servlet Methods init(): called one time when servlet engine brings servlet into memory doget(): used for processing page hits from browser –has a request and a response argument –response can be used to redirect browser to new servlet/URL service(): general form of request made to servlet

Copyright W. Howden9 Servlet Container Web server Container receives servlet request from Browser and invokes appropriate servlet service method First time servlet is loaded, its init() method is called Container maintains session objects – a kind of global object that servlets can use to store state

Copyright W. Howden10 DS Servlets StartUp Login AdminActions MemberActions

Copyright W. Howden11 Enterprise Java Beans Special Java classes “run” on a special server/container used for programming server side business logic 4 kinds –Session stateful, stateless –Entity container, bean managed persistence

Copyright W. Howden12 Sample EJB Container/Server Functions Create and destroy beans Handle network communications for remote method execution Maintain bean pools – multiple instances for load balancing Instantiate beans with data from data base Perform transaction synchronization

Copyright W. Howden13 Session Java Beans Correspond to business logic functionality Are not permanent, only exist for use of system DS e.g. –LogIn: called by LogIn servlet when user logs on (stateful – saves name, user type, etc.) –GetDate: called by MemberActions servlet if user has indicated get a date, and entered desired dater properties (stateless)

Copyright W. Howden14 Entity Java Beans Correspond to business logic permanent data DS e.g. –MemberData(we will choose container managed persistence)

Copyright W. Howden15 Enterprise Java Bean Classes Actual class, implements Session/Entity Bean Remote Interface – shows accessible methods –extends EJBObject EJB Object generated by container from Remote Interface Home Interface –extends EJBHome EJB Home Object generated by container from Home interface

Copyright W. Howden16 (Remote) Object Creation

Copyright W. Howden17 Home Object Functions Create an instance of an EJB object, or use existing instance from a pool Find existing EJB objects (entity beans) Remove EJB objects

Copyright W. Howden18 EJB Object Functions Creates or finds an instance of the associated actual bean to service the request e.g. an existing stateless session bean e.g.creates a new entity bean and fills in appropriate data from data base

Copyright W. Howden19 Session Bean Callback Methods Created by programmer Are called by system/container when it is about to do something to your bean ejbPassivate(): writing bean to temporary storage if there are too many beans (Stateful) ejbActivate():called after bean is brought back in ejbRemove(): cleanup before destruction

Copyright W. Howden20 Entity Bean Callback Methods ejbLoad() and ejbStore(): used by container to keep a bean consistent with data base ejbActivate() and ejbPassivate: used by container to allow entity bean to be reused for different data, i.e. transition into and out of an instance pool

Copyright W. Howden21 Other Entity Bean Methods ejbCreate(): creates a bean plus data in the underlying data base. Could also created data base entry separately ejbFindxxxx(): methods for loading some data base data. e.g. –ejbFindByPrimarykey() –defined automatically(container managed) or by user (bean managed)

Copyright W. Howden22 Deployment Use a deployment wizard Deploy using an Ejb-jar file –Enterprise beans –Remote interfaces –Home interfaces –Deployment descriptors Container tool generates home and EJB objects for you

Copyright W. Howden23 Deployment Descriptors Typical contents –Bean Home Name –bean class names –stateful or stateless –session timeout period

Copyright W. Howden24 Bean Design Issues GetDate session bean needs to look through the MemberData entity beans –use the get all finder to return an enumeration and then index through them? –have a more sophisticated finder that just gets the ones that match? Consistency problems –two different clients have different session objects that are altering the data base at the same time that getDate and LogIn might be reading from it.

Copyright W. Howden25 Sample DS Design Scenario Scenario 1 –user logs on, is found to be a member –system displays member options web page Scenario 2 –user enters desired properties on get date part of member options page, and hits enter –system finds a date and prints properties

Copyright W. Howden26

Copyright W. Howden27