Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.

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.
6/1/20151 Luca Simone Software Engineering 2 a.a. 2001/2002.
1 Softsmith Open Learning - EJB 21-Nov Enterprise Java Beans Introduction –Application ServerApplication Server –Java 2 Enterprise EditionJava.
June 1999 EJB1 EJB and CHAIMS Dorothea Beringer Enterprise Java Beans and how to build a CHAIMS infrastructure using the EJB paradigm.
Introduction to Enterprise JavaBeans. Integrating Software Development Server-side Component Model Distributed Object Architecture –CORBA –DCOM –Java.
Application Server Lecture Paulo Barroso Kris Carver Todd Kitterman Eric Silva.
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
Point Of Sale(POS) J2EE Application Department : Computer Science Degree : Master Student : Woojin Choi ID : (POS J2EE Application with JRun)
Java 2 Platform, Enterprise Edition (J2EE). Source: Computer, August 2000 J2EE and Other Java 2 Platform Editions.
SEI/CBS Initiative Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department of Defense © 1999.
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
CS 483 Enterprise and Web Application Programming
Emmanuel Cecchet et al.  Performance Scalability of J2EE application servers.  Test effect of: ◦ Application Implementation Methods ◦ Container Design.
Distributed System Using Java 2 Enterprise Edition (J2EE)
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.
Brad Rippe Fullerton College. What you need to get started? JDK 1.3 standard for compilation J2EE - SDK1.2.1 App Server - An EJB Container/Web Container.
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)
Seminar: Enterprise JavaBeans. Agenda Agenda Java™ 2 Platform Java™ 2 Platform Java™ 2 Platform,Enterprise Edition(J2EE) Java™ 2 Platform,Enterprise Edition(J2EE)
Enterprise JavaBeans EJB Container Services. EJB container Enterprise JavaBeans are deployed in an EJB container within the application server EJB container.
Entity Beans BMP Celsina Bignoli
Middleware Technology (J2EE/EJB) Entity Bean. 2 Introduction to Entity Beans Persistence Concepts Entity beans are persistent objects that can be stored.
Lecture 8 Advanced Topics in Enterprise JavaBeans.
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.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
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.
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.
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.
Message-Driven Beans and EJB Security Lesson 4B / Slide 1 of 37 J2EE Server Components Objectives In this lesson, you will learn about: Identify features.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Overview ver 1.0Page 1 © Wipro Technologies Talent Transformation J2EE Overview.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Lecture 7 Enterprise JavaBeans: Architecture and Goals.
© jGuru.com Enterprise JavaBeans Fundamentals.
Introduction to Enterprise JavaBeans Topics In Systems Architecture Barry Herbold
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
EJB Overview: Constraint Types and Enforcement in JBoss Elissa Newman Fluid Meeting 6/3/04.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Enterprise Java Bean Technology Briefing Markus Hebach.
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.
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.
Creating competitive advantage Copyright © 2003 Enterprise Java Beans Presenter: Wickramanayake HMKSK Version:0.1 Last Updated:
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
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.
14 Copyright © 2004, Oracle. All rights reserved. Achieving State Management in the Business Tier.
©NIIT Session Beans Lesson 1B/ Slide 1 of 37J2EE Server Components Objectives In this lesson, you will learn to: Describe the characteristics of session.
Luca Simone Software Engineering 2 a.a. 2001/2002
Objectives In this lesson, you will learn to:
Understanding and Designing with EJB
Knowledge Byte In this section, you will learn about:
Component-based Applications
Understanding and Designing with EJB
Enterprise Java Beans Bina Ramamurthy 4/5/2019 B.Ramamurthy.
Knowledge Byte In this section, you will learn about:
Objectives In this lesson, you will learn about:
Presentation transcript:

Enterprise JavaBeans

Lesson 1: Introduction to Server-Side Component Software

Objectives  Define client-server and multi-tier architecture  Discuss the benefits and issues of distributed architectures  Define software components  Discuss server-side component architecture and architecture solutions  Define J2EE technologies  Define EJB technology

Client-Server and Multi-Tiered Architectures  Scalability  Extensibility  Security  Issues concerning distributed architectures - Complexity - Communication/bandwidth - Maintenance costs

Centralized Mainframe Architecture

Two-Tier Architecture

Three-Tier Architecture

Software Components  Component architectures - Component development tools - Container - Maintenance deployment tools

Component Architecture Solutions .NET Enterprise Architecture  CORBA  J2EE

J2EE Technologies  EJB  RMI/RMI-IIOP  JNDI  JDBC  JTA/JTS  JMS  JSP  IDL  JavaMail  Connectors  XML

Enterprise JavaBeans  Differences between JavaBeans and Enterprise JavaBeans  EJB development tasks - J2EE product provider - Bean developer - Application assembler - Deployer - System administrator - Tool provider

Summary Define client-server and multi-tier architecture Discuss the benefits and issues of distributed architectures Define software components Discuss server-side component architecture and architecture solutions Define J2EE technologies Define EJB technology

Lesson 2: Overview of the Enterprise JavaBeans Framework

Objectives  Define an EJB server’s main components  Discuss EJB and client interaction  Identify EJB container services  Describe home objects and EJB objects  Compare session beans and entity beans  Define a deployment descriptor  Identify the EJB-JAR file

EJB Architecture  Primary components - EJB-compliant server - EJB-compliant container - Home object (bean factory) - EJB object (remote interface) - EJB

Example of EJB Architecture

Client Interaction with Enterprise JavaBeans

EJB Container Services  Distributed transaction management  Persistence  Security  Component resource and life cycle management  Remote accessibility  Transparent location of components  Identification of components

The EJB Home Object  Location transparency

The EJB Object Stubs Skeletons

Types of Enterprise JavaBeans  Session beans - Stateful - Stateless  Entity beans

Deployment Descriptors  An XML document that describes the properties of an EJB

The EJB-JAR File  Contains the class files for a bean, its home and remote interfaces, and the deployment descriptors

Summary Define an EJB server’s main components Discuss EJB and client interaction Identify EJB container services Describe home objects and EJB objects Compare session beans and entity beans Define a deployment descriptor Identify the EJB-JAR file

Lesson 3: Creating Session Beans

Objectives  Define the methods of the SessionBean interface  Describe the EJBContext and the SessionContext interfaces  Contrast stateful and stateless session beans  Explain how to write business methods for a session bean  Discuss the enterprise bean’s life cycle

Objectives (cont’d)  Create a session bean  Define the EJBHome and EJBObject interfaces and their methods  Discuss the superclass for the home and remote interfaces  Describe system and application exceptions  Deploy and connect to a session bean

Creating the Enterprise Bean Class  ejbCreate methods  The SessionBean interface  The EJBContext interface  The SessionContext interface

Stateless and Stateful Session Beans  Stateless session beans - Do not keep track of any information from one method call to the next  Stateful session beans - Can change their state during a conversation with a client

Writing Business Methods for an Enterprise Bean  Each EJB must declare the business methods that define the work that the EJB is designed to perform

The Home Interface  Extends EJBHome  Provides mechanisms to create and remove EJB components

The EJB Object  Extends the EJBObject interface

Exceptions in EJB  System exceptions  Application exceptions

Example: A Session Bean  The Teller bean class  The Teller remote interface  The Teller home interface

The Library Application  The Book entity bean  The Patron entity bean  The CheckOutRecord entity bean  The CheckOut session bean  The CheckIn session bean

LibraryDB Schema

Summary Define the methods of the SessionBean interface Describe the EJBContext and the SessionContext interfaces Contrast stateful and stateless session beans Explain how to write business methods for a session bean Discuss the enterprise bean’s life cycle

Summary (cont’d) Create a session bean Define the EJBHome and EJBObject interfaces and their methods Discuss the superclass for the home and remote interfaces Describe system and application exceptions Deploy and connect to a session bean

Lesson 4: Enterprise JavaBeans Clients

Objectives  Use JNDI to obtain a reference to the home object  Instantiate an EJB instance using the home object  Call an enterprise bean's business methods  Remove an enterprise bean  Write an EJB client

Using JNDI

Creating an EJB Instance  Invocation of business methods

Summary Use JNDI to obtain a reference to the home object Instantiate an EJB instance using the home object Call an enterprise bean's business methods Remove an enterprise bean Write an EJB client

Lesson 5: Entity Beans

Objectives  Discuss entity beans and their persistence management techniques  Identify the methods of the EntityBean and EntityContext interfaces  Define primary keys and describe their use  Describe the mechanics of entity beans  Use finder methods  Write an entity bean and its interfaces

What Is an Entity Bean?  Object serialization  Object-relational mapping  Bean-managed persistence  Container-managed persistence  Primary keys

Entity Bean Architecture  Creating entity beans  Invoking business methods on entity beans  Swapping entity beans  Invoking remove() on an entity bean

Life Cycle of an Entity Bean Instance

Bean-Managed Persistence  BMP - SQL - JDBC

Using Resource Factories

Entity Bean Methods ejbCreate() ejbPostCreate() ejbRemove() ejbLoad() ejbStore()

Using Finder Methods  ejbFindByPrimaryKey()  Multiple row finders

The Remote Interface and the Home Interface  Remote interface - Provides the interface for the client - Exposes methods for manipulating the entity bean  Home interface - Contains the create() and find…() methods for an entity bean

Summary Discuss entity beans and their persistence management techniques Identify the methods of the EntityBean and EntityContext interfaces Define primary keys and describe their use Describe the mechanics of entity beans Use finder methods Write an entity bean and its interfaces

Lesson 6: Container-Managed Persistence

Objectives  Discuss entity beans and CMP  Explain the benefits and disadvantages of using CMP  Describe the primary key as it relates to CMP  Define an ejbCreate() method that uses CMP  Write the requisite methods for an entity bean to use CMP

Introduction to Container- Managed Persistence (CMP)  Benefits - Less code needed - Optimization techniques - More portable - Fewer bugs  Disadvantages - Less flexibility - Inaccessible code

The Primary Key  Primary key class - Must be serializable - Must be of a legal value type in RMI-IIOP

EJB Methods and CMP  ejbCreate()  ejbRemove()  ejbLoad()  ejbStore()  Other methods  Finder methods

The Deployment Descriptor  EJB requirements  DD XML tags

The Deployment Descriptor and CMP  Example: A CMP entity bean - The EmployeeEJB bean class - The home interface - The remote interface

Summary Discuss entity beans and CMP Explain the benefits and disadvantages of using CMP Describe the primary key as it relates to CMP Define an ejbCreate() method that uses CMP Write the requisite methods for an entity bean to use CMP

Lesson 7: Transactions in Enterprise JavaBeans

Objectives  Define transactions and explain their use  Distinguish transaction participants  Define transaction properties  Explain the EJB transactional model  Describe distributed transactions  Define transaction isolation levels  Discuss EJB transaction attributes

What Are Transactions?  Operations or series of operations that are treated as single units of work  Transactional management

Participants in Transactions  Transactional objects or applications  Transaction managers  Resources  Resource managers

Properties of Transactions  Atomicity  Consistency  Isolation  Durability

EJB Transactional Model  Flat transactional model  Nested transactional model

Flat Transactional Model

Nested Transactional Model

Distributed Transactions  Two-phase commits  Transparent transaction control - Transaction context

Isolation Levels  Strict - Each concurrent transaction is isolated from all other transactions  Nonstrict - Increased transactional performance - Possibility of corrupted data

Transactions in EJB  Transaction demarcation  Container-managed transactions - Attributes  Defining CMT in the DD  Setting CMT in Deploytool

Container-Managed Transactions  Container-managed transaction attributes  Which methods require transaction attributes?  The setRollbackOnly( ) and getRollbackOnly( ) methods  Defining CMT in the DD  Setting CMT in Deploytool

Bean-Managed Transactions  UserTransaction interface - Properties - Methods  Setting BMT in the DD  BMT and stateful session beans  BMT and stateless session beans

Summary Define transactions and explain their use Distinguish transaction participants Define transaction properties Explain the EJB transactional model Describe distributed transactions Define transaction isolation levels Discuss EJB transaction attributes

Lesson 8: Enterprise JavaBeans Security

Objectives  Define users in EJB security  Discuss principals in EJB security  Identify roles in EJB security  Describe the DD’s role in EJB security  Explain the EJB container’s role in EJB security

Defining Users, Principals and Roles  Overview of EJB security - Authentication - Authorization  Authorization in EJB code

Example: Users, Principals and Roles

Security and the Deployment Descriptor  The bean developer and the DD  The application assembler and the DD  The deployer and the DD

Summary Define users in EJB security Discuss principals in EJB security Identify roles in EJB security Describe the DD’s role in EJB security Explain the EJB container’s role in EJB security

Enterprise JavaBeans Introduction to Server-Side Component Software Overview of the Enterprise JavaBeans Framework Creating Session Beans Enterprise JavaBeans Clients

Enterprise JavaBeans Entity Beans Container-Managed Persistence Transactions in Enterprise JavaBeans Enterprise JavaBeans Security