





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















They can represent data
They can represent behavior
EJB in the Big Picture of J2EE
The EJB instance itself is the server
EJBs have clients (objects that call its methods)
Java Applets and Applications (using RMI or CORBA)
Non-Java applications (using CORBA)
JSPs and Servlets (using RMI or CORBA)
Other EJBs (using RMI or CORBA)
EJBs & 3-Tiered Architectures
Applet Web Page
Servlets & JSPs
EJBs
Database
Client Tier
Server Tier
Database Tier
In enterprise systems, EJB clients areusually: Servlets, JSPs, or Other EJBs
If all of the business logic operations and datamanipulations are done using EJBs, the JSPs andServlets will be focused mainly on displaying theresults of those operations
Session EJBs: Used to represent system behavior (i.e.business logic)
e.g. Storing products to purchase in the shopping cart
Entity EJBs: Used to represent & manipulate system data
e.g. Finding products that match a search term
Alternatives to EJBs
Persistence (of CORBA object data)
Transactions (between CORBA objects)
Security (between CORBA objects)
Except that EJBs can only be created in Java
EJB Types
Subtypes of Session Beans
Stateful:
Stateless:
Entity beans represent data in the system
In addition, entity beans are used to search for, modify, create anddelete data
Usually, this data resides in a relational database
Each entity bean typically represents a single row in some databasetable
An entity bean instance exists as long as the data is beingused
When the EJB client is done with the instance, the entity beaninstance usually returns to a bean pool
The client for an entity bean is typically a session bean, sincebehavior usually involves the manipulation of data
Describes the interface provided to EJB clients
The implementation of the bean
Describe