Beruflich Dokumente
Kultur Dokumente
Agenda
Background
JavaBeans
What is EJB?
Architecture
Roles
Steps involved
Questions?
Monolithic systems
Background
No reuse
Fat clients,
data model reused
Client/server
Thin clients,
both data model and N-Tier
business logic reused
3-tier architecture
Presentation Clients, GUI
Data DBMSs
The J2EE
Consists of 12 APIs:
Naming service
provides a common way of naming objects and
directories
Java Naming and Directory Interface (JNDI)
Transaction handling
Java Transaction Services (JTS)
Presentation (JSP, Servlet)
Communication (RMI)
Distribution, component model (EJB)
What is Enterprise Java
Beans?
defines a standard to build distributed
systems on the server side
frees developers from “plumbing” (s.a.
transactions , security, pooling, etc.)
is a framework to create enterprise
middleware
Why EJB
Independence of middleware (both
regarding hard- and software)
Automatic transaction handling
Automatic distribution
Portability
Scalability
Tightly coupled to CORBA
JavaBeans vs. EJB
Can be visible or Are always invisible
invisible Are distributed executable
components on a server
Designed to run locally Are described with a
Are described with DeploymentDescriptor
Properties, BeanInfo Can not be used as a ActiveX
classes and control
Customizers
May be used as an
ActiveX control
EJB
client architecture
EJB server
EJB container
EJB Home
EJBean
EJB Object
security
JNDI
JTS
…..
Different types of EJBs, 1
Entity bean
corresponds to a record in a
database
Session bean
handles business flow
(one per client)
Different types of EJBs, 2
EJB
Entity Session
import javax.ejb.*;
import java.rmi.RemoteException;
import java.util.*;
import java.rmi.RemoteException;
import javax.ejb.*;
import java.util.Hashtable;
}
Example
Entity bean - EmployeeBean.java
public class EmployeeBean implements EntityBean {
public int EmployeeId; // also the primary Key
public String firstName
public String lastName;
public String title;
public String SSN;
package examples.ejb.personnel;