Presentation is loading. Please wait.

Presentation is loading. Please wait.

Overview Of Enterprise Java Bean (EJB) COSC 513 Presentation Mei Li March 17, 2001.

Similar presentations


Presentation on theme: "Overview Of Enterprise Java Bean (EJB) COSC 513 Presentation Mei Li March 17, 2001."— Presentation transcript:

1 Overview Of Enterprise Java Bean (EJB) COSC 513 Presentation Mei Li March 17, 2001

2 What is EJB ? zWidely adopted N-tier sever side component architecture for J2EE. zAllows developers to quickly create scalable, versatile, reusable and portable applications. zIt provide complex middleware enterprise features at no cost to application developers.

3 N-tier Sever side component architecture Presentation Logic Pricing Shopping cart Billing DB Driver DataBase Firewall Presentation Layer Business Logic Layer Data Layer

4 The Benefits of EJB zRapid application development zBroad industry adoption zApplication portability yBusiness logic is platform independent and middleware independent. zProtection of IT investment ywrap or embrace existing infrastructure ysimplifies or enhances CORBA and DCOM

5 EJB Architecture EJB Server & Container Home Object EJB Object Client Home Interface Remote Interface (1) (2) (3) (4) Enterprise Beans (5) (1) Create me a new EJB object (2) Create EJB object (3) Return EJB object reference (4) Invoke business method (5) Delegate request to bean

6 EJB Server zProviding a runtime environment for one or more containers. zManaging low-level system resources, allocating resources to containers, multiprocessing, load balancing, providing naming and transaction service and making container visible.

7 EJB Container zProviding a playground where your enterprise beans can run. zResponsible for managing the beans running within them. zActing as an interface between your enterprise beans and the outside world. Client can never directly access your enterprise beans.

8 EJB Client zMaking use of EJB beans for operations. zFinding the home object through JNDI. zInvoking the business method on EJB object. zCan be servlets, applets, CORBA / IIOP EJB clients, etc.

9 Enterprise Beans zThere are two types of Enterprise Beans: ySession Beans xStateless session beans xstateful session beans yEntity Beans xBean managed persistent entity beans (BMP) xcontainer managed persistent entity beans (CMP)

10 Session Beans vs. Entity Beans zSession Bean yrepresent a business process, e.g. Billing credit card, trading stocks. yis associated with one client and the life of the session bean is the life of the customer. ydo not survive from the server crashes z Entity Bean yrepresentation of persistent data ycan be shared by multiple clients ycan read from DB and save back to DB yhas much longer life and can survive from server crashes

11 Activation vs. Passivation zActivation yWhen a client needs to use a bean that has been passivated, an activation process occurred. yThe state of the bean is swapped in from the persistent storage z Passivation yIf too many beans are instantiated, EJB container can passivate some of them ythe state of the bean is saved in a persistent store or file and swapped out

12 Stateless vs. Stateful zStateless yno internal state ycan be pooled to service multiple client yneed not to handle activation and passivation yexamples: calculator z Stateful ypossess internal state yneed to hand activation and passivation yexamples: shopping cart

13 Container Managed Persistent vs. Bean Managed Persistent zContainer Managed yEJB container is responsible for saving and retrieving bean’s state yIndependent of data source yEasy to develop z Bean Managed yEntity bean is responsible for saving bean’s state. yLess adaptive than container managed entity bean ypersistence need to be hard coded into the bean

14 Deployment Descriptor zAn essential part of EJB. Use XML after EJB1.1 zEnables EJB containers to provide implicit middleware services to enterprise beans without coding to any middleware API. zIt declares bean management and life-cycle requirement, persistence requirement (entity bean only), transaction requirements and security requirements

15 Summary zEJB is server side components written in JAVA zEJB components contains business logic only, no system-level programming zSystem-level service like transaction, security, threading, and persistence are automatically managed by EJB server/container.

16 Summary (cont’s) zComponents are declaratively customized (can customize transactional behavior, life-cycle, state management, security issue.) zEJB architecture are transactional, distributed, portable, multi-tier, scalable and secure. zEJB components are fully portable across any EJB server and any operating system.

17


Download ppt "Overview Of Enterprise Java Bean (EJB) COSC 513 Presentation Mei Li March 17, 2001."

Similar presentations


Ads by Google