1 / 17

Overview Of Enterprise Java Bean (EJB)

Overview Of Enterprise Java Bean (EJB). COSC 513 Presentation Mei Li March 17, 2001. What is EJB ?. Widely adopted N-tier sever side component architecture for J2EE. Allows developers to quickly create scalable, versatile, reusable and portable applications.

khuyen
Télécharger la présentation

Overview Of Enterprise Java Bean (EJB)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

  4. The Benefits of EJB • Rapid application development • Broad industry adoption • Application portability • Business logic is platform independent and middleware independent. • Protection of IT investment • wrap or embrace existing infrastructure • simplifies or enhances CORBA and DCOM

  5. EJB Architecture EJB Server & Container Home Interface Client (1) Home Object (3) Enterprise Beans (2) (4) (5) EJB Object Remote Interface (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 • Providing a runtime environment for one or more containers. • Managing low-level system resources, allocating resources to containers, multiprocessing, load balancing, providing naming and transaction service and making container visible.

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

  8. EJB Client • Making use of EJB beans for operations. • Finding the home object through JNDI. • Invoking the business method on EJB object. • Can be servlets, applets, CORBA / IIOP EJB clients, etc.

  9. Enterprise Beans • There are two types of Enterprise Beans: • Session Beans • Stateless session beans • stateful session beans • Entity Beans • Bean managed persistent entity beans (BMP) • container managed persistent entity beans (CMP)

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

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

  12. Stateless no internal state can be pooled to service multiple client need not to handle activation and passivation examples: calculator Stateful possess internal state need to hand activation and passivation examples: shopping cart Stateless vs. Stateful

  13. Container Managed EJB container is responsible for saving and retrieving bean’s state Independent of data source Easy to develop Bean Managed Entity bean is responsible for saving bean’s state. Less adaptive than container managed entity bean persistence need to be hard coded into the bean Container Managed Persistent vs. Bean Managed Persistent

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

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

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

  17. The End

More Related