1.44k likes | 1.45k Views
Enterprise JavaBeans™ A COTS Architecture for Modern Enterprise Systems Kurt Wallnau • Robert Seacord • John Robert • Santiago Comella. Outline of Today’s Tutorial. Why Enterprise JavaBeans™ (EJB)? An Overview of EJB Security and Transactions Portability and Legacy Systems
E N D
Enterprise JavaBeans™ A COTS Architecture for Modern Enterprise Systems Kurt Wallnau•Robert Seacord•John Robert•Santiago Comella
Outline of Today’s Tutorial • Why Enterprise JavaBeans™ (EJB)? • An Overview of EJB • Security and Transactions • Portability and Legacy Systems • Summary and the Future of EJB
Why Enterprise JavaBeans™? • The Nature and Challenges of Enterprise Systems • Best of Breed vs. Off-the-Shelf Infrastructures • Closed vs. Open Infrastructures • Enterprise JavaBeans™ (EJB) Benefits • Technical/Market/Business Triangulation
What are Enterprise Systems? • Enterprise systems (ES) automate business processes, i.e., how work gets done • Enterprise systems are1 • large • heterogeneous • distributed • evolving • dynamic • long lived • mission critical • systems of systems • 1. John Salasin, “DAMES: Dynamic Assembly of Military Enterprise Systems,” briefing materials
Challenges of Enterprise Systems ES Property ES Challenge
ES’s Are Big Business • Estimates of ES1 market in federal systems alone is currently $3.7 billion, up from 1998 estimate of $2.8 billion • BAAN, SAP, PeopleSoft and other enterprise resource planning (ERP) systems are meeting this demand • Software component technologies are another market response • Estimates of this market range from $7 billion by 20022 to $12 billion by 20013 • 1. http://www.planetit.com/techcenters/docs/enterprise_apps/news/PIT19990707S0003 • 2. Gartner Group • 3. IDC http://www.selectst.com/downloads/IDC/IDC.asp
Structure of an Enterprise System Clients Business Logic • There are various ways of viewing enterprise systems • 2-tiered, 3-tiered, N-tiered • by infrastructure technology • This N-tiered view will serve our purposes for today Business Objects (Shared Data) Infrastructure Platform (HW/OS)
Clients Business Logic Business Objects (Shared Data) Infrastructure Platform (HW/OS) Structure of an Enterprise System • business rules • application services Our focus is here... • relational data • object-to-relation mapping • distribution, events, naming, • transactions, security, etc.
ES Infrastructures are Complex The technical infrastructure needed for mission-critical applications is non-trivial Business Logic Networking Connection mgmt Security Business Objects (Shared Data) Transactions Thread Pool Infrastructure (e.g., Middleware) Synchronization Persistence Naming System mgmt Load Balancing Failover
“Best of Breed” Infrastructure is Problematic: The GEE Experience Netscape Browser & ES Visibroker/Java Microsoft Explorer & IIS OrbixWeb Networking Java Web Server JDK/RMI Connection mgmt Netscape DS JSAFE JCE Security Microsoft IIS CRYPTIX Transactions Java Key SSLEAY Thread Pool Visibroker/C++ ITS Synchronization Persistence Microsoft Access Naming Oracle 7.x and 8.x System mgmt ODBC/JDBC Load Balancing Netscape DS Orbix Names Failover Visi Names Microsoft IIS
The GEE: Some Lessons • We built an enterprise infrastructure from COTS “parts” choice-points for product specific options • product selections limited by “ensemble effect” • latest versions of products often are often un-integratable with previous ensemble • significant ongoing cost for product tracking and evaluation of new releases • complex rules for build and deploy • product/technology insulation is very very hard • tremendous vertical and spanning product and technology competency needed • product and technology competency is a wasting asset
Clients 1.1 1.2 Proprietary Scripting and Modeling Tools 1.3 Infrastructure Platform (HW/OS) COTS ERP: Proprietary, Vertically-Integrated ES Pre-specified business processes, process templates and data items Pre-Integrated Infrastructure using vendor selected products and policies
EJB: Specification for “Open” but Proprietary ES Frameworks Clients COTS Bean Families SessionBeans for Service Connections EntityBeans for Persistent Data Infrastructure Specification of security, persistence, life cycle, naming, transactions via server and container contracts Platform (HW/OS)
COTS ERP vs. EJB: pros and cons Enterprise JavaBeans™ COTS ERP Package
Rationale for EJB? ES Property ES Challenge EJB Benefit
To Bean or Not To Bean? (1) • Ultimately this will require consideration of technical, market and business pros and cons • Technical • + The J in EJB addresses heterogeneity • + Specification ties together a variety of ES infrastructure services in a “standard” way • - The J in EJB may suffers from performance problems and JVM bugs • - Not all services are sufficiently well defined to enable cross-container bean portability
To Bean or Not to Bean? (2) • Market factors refer to the performance and viability of EJB in the technology marketplace: • + EJB may unify a fragmented “app server” market, and jumpstart a market in servers and containers • + EJB leverages tremendous interest in Java, and many EJB servers are now available • - EJB is not “open”--Sun controls the spec, and its future evolution is unpredictable • - Technology battle with Microsoft and fast Java evolution guarantee continued EJB instability
To Bean or Not To Bean? (3) • Business factors will be particular to each organization. These are representative pros/cons • + Organization is engaged in a general switchover to Java technology, so why wait? • + Market in server/container providers provide competitive alternatives and fallbacks • - Technology instability and immaturity will cause delays, rework, risking added cost and delayed time to market • - EJB vendors will continue to provide proprietary and non-standard features
The Remainder of the Tutorial • John Robert describes EJB in detail • Robert Seacord takes a more in-depth look at several aspects of EJB and discusses strengths and weaknesses found • Santiago Comella-Dorda discusses issues of Enterprise JavaBean portability and integration with legacy systems • Robert Seacord closes with a brief summary and some thoughts on the future of EJB
Enterprise JavaBeans™ Overview
EJB Overview • What is EJB? • EJB Roles • EJB Architecture • EJB Services • Building an EJB Application • EJB & CORBA • Summary
EJB in the n-Tier System You Are Here Browser Client Applet Database Client Application Legacy Systems EJB Server Clients Application Data
What is EJB? • Specification for component based distributed computing framework using Java technology. • Enterprise JavaBeans Specification describes • roles and responsibilities for component-based software development of server-side applications. • an architecture including EJB Servers, Containers, and Beans. • a set of services including naming, transactions and security. • interoperability with database servers and CORBA applications.
EJB Specification • Evolving Technology • Release 1.0 - March 98, Final • Release 1.1 - May 99, Public Draft • Goals • Component-based software development. • Separate business logic from system code. • Address application life cycle. • Compatible with CORBA (non Java apps). • Specification owned by Sun and supported by 40+ companies.
EJB Roles Bean Provider - Producer of enterprise beans. - Combines enterprise beans into larger deployable parts. - Deploys enterprise beans into a specific operational environment. - Container provider and server provider. - Configuration and administration of infrastructure. Application Assembler Application Development and Deployment Deployer Platform Provider System Admin.
EJB Architecture The container is the platform. The component is your application. Picture provided by Sun Microsystems, Inc.
EJB Platform Provide naming service using JNDI Provide OMG/OTS compliant transaction service Container EJB Server Manage EJ Bean life cycle Make EJ Bean Interfaces Available with JNDI Provide basic security services Persistence Management (DBMS and other) Manage transaction context
Select EJB complaint platform for purchase (1.0 or 1.1). EJB Platform vendors supplement standard EJB with proprietary features. Current Vendors include BEA Systems - WebLogic Bluestone - Sapphire/Web IBM - WebSphere Inprise - Application Server Oracle - Oracle8i Persistence - PowerTier Sun/Netscape alliance - reference implementation EJB Platform Vendors
Enterprise JavaBeans™ Component EJB Application Application consists of multiple beans Beans are “portable” across containers Beans can be purchased or constructed
Types of Enterprise JavaBeans • Session Bean • Used for client interface • Not shared between clients • Two kinds of Session Bean: • stateless - common object identity • stateful - unique object identity • Entity Bean • Maps to data in database or application • Shared between clients • Persistent state • container managed - access defined at deployment • bean managed - access defined as part of bean • Support optional in 1.0 and mandatory in 1.1
Mixing Beans • EJB applications use a combination of entity beans and session beans to implement business logic. PrefixBean Database Client EchoServiceBean SuffixBean Session Bean Entity Bean Application Server Application Server
EJB Client Interfaces Factory Interface Finder Interface EJBHome EJBObject Remote Interface Contains bean services seen by clients
EJB Architecture The purchased EJB server is the platform. The application consists of session and entity beans. Application interfaces are made available to clients at time of deployment. Picture provided by Sun Microsystems, Inc.
Deployment descriptor Deployment Platform Specific Implementation of Bean • Deployment provides a mechanism for adapting a component for a specific runtime environment. • Deployment is an intermediate step between coding a bean and executing a bean. By using a deployment descriptor, some attributes of the bean implementation are specified by the deployer, and implemented by the platform provider. • Two kinds of information in a deployment descriptor • Enterprise beans’ structural information - can’t change • Application assembly information - can change Bean Deploy +
EJB Overview • What is EJB? • EJB Roles • EJB Architecture • EJB Services • Building an EJB Application • EJB & CORBA • Summary
EJB Services • Standard EJB services allow application developers to • focus on business logic rather than infrastructure • defer responsibility for common services to the EJB platform • create “portable” applications that can be reused • support a component marketplace • Standard EJB services include • Persistence • Naming • Transactions • Security
Persistence • EJB Definition • “The data access protocol for transferring the state of the entity between the enterprise bean instance and the underlying database is referred to as object persistence.” • Two types of persistence • bean-managed - persistence logic implemented directly inside the enterprise bean class. • container-managed - persistence logic delegated to container. • The underlying data source may be an existing application rather than a database.
Bean-Managed Persistence • EntityBean • SQL code • persistence logic • Enterprise bean provider writes database access calls (using JDBC or SQLJ) directly in the entity bean. • Entity bean is tied to the data source in which the entity is stored. • More portable across EJB platforms than container-managed entity bean. Deploy • Bean • SQL code • persistence logic + Deployment Descriptor persistence-type
Container-Managed Persistence EntityBean • Data access components (like JSBC and SQLJ calls) are generated at deployment time by container tool. • Entity bean is independent from the data source in which the entity is stored. • Less development effort for bean provider. Deploy + • Bean • generated SQL code • generated persistence logic Deployment Descriptor persistence-type cmp-fields
Name Service - Deployment • Benefits • EJB server has built-in name server. • Service name of bean is assigned at deployment time, not compile time. • Some EJB servers support enterprise bean replication. Deploy Deployment Descriptor bean home name
Name Service - Lookup • Benefits • JNDI allows clients to use one interface for locating CORBA, LDAP, NDS, and file objects. • Allows management of enterprise wide services using naming hierarchy. MyClient Context ct= getInitialContext(…) ct.lookup(“EchoService”) Runtime
Transactions • Benefits • EJB applications can defer transaction logic to EJB server and container. • Distributed transactions. Picture provided by Sun Microsystems, Inc.
Security • Benefits • Permissions specified for each bean service at deployment time. • Builds on security of JDK. Detailed discussion by Robert Seacord. Deploy Deployment Descriptor security roles ... • Generated Bean Code • security logic
Building an EJB Application How do we build an EJB application? Client Database Application Server
Step 1: Create Interfaces EJB Server Specifies the life cycle interfaces public interface AccountHome extends EJBHome{ public create(…) public findByPrimaryKey(..) Home I/F Client Database Specifies the interface provided to bean clients public interface Account extends EJBObject{ public getName(…) public setName(…) Remote I/F EJB specification This is generated You write this
Step 2: Create Implementation EJB Server Home I/F Client Database Account implements EntityBean Implements bean interfaces public class AccountBean implements EntityBean { public void ejbActivate(...) {………} public void ejbPassivate(…) {……….} public getName(…) {……..} public setName(…) {…….. } Remote I/F EJB specification This is generated You write this
Deployment descriptor Step 3: Deployment Descriptor EJB Server Home I/F Client Database Account implements EntityBean “Tells” the container how to deploy the bean (how to do DBMS access, transactions, security, naming, etc.) Remote I/F EJB specification This is generated You write this
Deployment descriptor Step 4: Deploy EJB Server Home obj implements Home I/F Client Database Account implements EntityBean delegates Remote obj implements Remote I/F EJB specification This is generated You write this
Entity Bean Inheritance - 1 Java.rmi.Remote Java.io.Serializable JDK EJBMetaData EnterpriseBean EJBObject EJB Spec EJBHome EntityBean Bean Provider (Wombat) Container Provider (Acme) Produced by Acme tools Extends or implements interface Extends implementation, code generation or delegation