Copyright by BrainStream Co., Ltd Introduction to Java 2 Enterprise Edition Introduction to Java 2 Enterprise Edition Adhiwat Kosakarika [email protected]– Sun Certified Java Programmer – IBM Certify Enterprise Connectivity with J2EE – IBM Certify Enterprise Application Development with IBM WebSphere Studio, V5.0
50
Embed
Introduction to Enterprise JavaBean - Kasetsart University · 11.12.2004 · Introduction to Java 2 Enterprise Edition Adhiwat Kosakarika [email protected] – Sun Certified Java Programmer
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Copyright by BrainStream Co., Ltd
Introduction to Java 2 Enterprise EditionIntroduction to Java 2 Enterprise Edition
Protocol– Microsoft Distributed Component Object Model
(DCOM).
In Java world, only CORBA and RMI they relate EJB.
Copyright by BrainStream Co., Ltd /Page32
CORBA OverviewCORBA Overview
Developed by a consortium of companies, Object Management Group.Provide a common, language- and vendor-neutral standard for Object DistributionStandard Interface enables interoperability between different vendors.Built around a special layer, Object Request Broker (ORB), that communication between clients and objects.
Copyright by BrainStream Co., Ltd /Page33
CORBA OverviewCORBA OverviewCommunicated between ORB by Internet-Inter ORB Protocol (IIOP).
Stub: marshalling of parameters of remote object.
Skeleton: unmarshalling of parameters of remote object.
Copyright by BrainStream Co., Ltd /Page34
CORBA OverviewCORBA Overview
CORBA clients/servers can base on variouslanguages(Java, C++, C, Smalltalk and Ada), Operating System, Networks.Two key building blocks in CORBA model:Interface Definition Language (IDL)– Normalizes differences caused by language or
operating system dependencies.
CORBA services– Provide standard to interact, such as naming
and transaction.
Copyright by BrainStream Co., Ltd /Page35
VisiBrokerVisiBroker JAVA CORBA DevelopmentJAVA CORBA Development
Create IDL.
Idl2java.
Create Client.
Create Object.
Compile.
Start Server.
Run Client.
Copyright by BrainStream Co., Ltd /Page36
VisiBrokerVisiBroker JAVA/C++ CORBAJAVA/C++ CORBA
Copyright by BrainStream Co., Ltd /Page37
Java Interface Definition LanguageJava Interface Definition Language
Is an implementation of CORBA specification.
Enables interoperability and connectivity with heterogeneous objects.
ORB provided with JDK 1.2.
Invoke remote network services using industry standards IDL and IIOP from OMG.
RMI uses object serialization to marshal and demarshal parameters
Allows RMI programs to pass by value objectsthat server can operate on a local copy.
Another advanced feature of RMI is distributed garbage collection, a feature that is not available in CORBA today.
Copyright by BrainStream Co., Ltd /Page40
Remote Method InvocationRemote Method Invocation
RMI Protocol called JRMP.
Work with only Java Language.
Lack of multiple-language support.
Lack of CORBA services such as naming service, transaction, persistence service and security.
Copyright by BrainStream Co., Ltd /Page41
RMI over IIOPRMI over IIOP
Neither CORBA nor Java RMI were sufficient enough to building enterprise applications.
RMI over IIOP (RMI-IIOP) combines the best features of RMI with those of CORBA.
Synthesis of RMI-IIOP results in a unique combination of power and ease of use, the Enterprise JavaBeans.
Copyright by BrainStream Co., Ltd /Page42
From CORBA to EJBFrom CORBA to EJBCORBA has some drawbacks:– CORBA has a steep learning curve. Many cases
low-level APIs are too complex.– Different CORBA infrastructures were less
portable. – CORBA had no complete server-side component
model and distributed object framework. – CORBA vendors (or developers) had to integrate
CORBA services with a own, non-standard application layer.
Copyright by BrainStream Co., Ltd /Page43
From CORBA to EJBFrom CORBA to EJB
In 1998, SUN Micro system introduction EJB.
In 1999, OMG group has published CORBA Component Model (CCM).
The Most Application server market focus on EJB component solutions.
EJB was designed to be 100% CORBA-compliant.
Copyright by BrainStream Co., Ltd /Page44
From CORBA to EJBFrom CORBA to EJBEJB technology easier to build applications on top of a CORBA infrastructure.
With EJB,low-level APIs has been shifted from the application developer to the application server infrastructure (EJB container).
Business LogicApplication Server
Copyright by BrainStream Co., Ltd /Page45
Enterprise JavaBeansEnterprise JavaBeans
Enterprise JavaBeans (EJB) is an architecture for server-side component based distributed applications written in Java.
Provides separation of business logic with persistency, transactions, and other services
Copyright by BrainStream Co., Ltd /Page46
EJB specificationEJB specification
“The EJB architecture is a component architecture for development and deployment of component-based distributedbusiness applications”– Defines how server-side components are
written.
– Provides a standard architectural contract between components and container/servers.
– Interoperability EJB servers or CORBA.
Copyright by BrainStream Co., Ltd /Page47
Enterprise JavaBeansEnterprise JavaBeans
EJB container is where EJB reside and make EJB available to client.
EJB are deployed into EJB containers and run on Server that provides services.
Copyright by BrainStream Co., Ltd /Page48
Enterprise JavaBeansEnterprise JavaBeans
Located EJB through JNDI.EJB can accessible methods of remote object by RMI. EJB use RMI-IIOP, standard mapping of EJB interfaces to CORBA IDL. EJB offered through JTA/JTS for Distributed Transaction. EJB provide Messaging with JMS.