A Distributed Component Architecture Model: Viewpoints
A Distributed Component Architecture Model: Viewpoints
A Distributed Component Architecture Model: Viewpoints
J2EE
A Distributed Component Architecture Model
By Mike Brevoort, Sr. Associate Mike Steinley, Sr. Associate Heather Spinnenweber, Sr. Associate
LiquidHub, Inc.
Suite 300
Wayne, PA 19087
484.654.1400
www.liquidhub.com
ViewPoints
Topics covered in this paper include:
Distributed Component Models The J2EE Component Model J2EE Architectural Overview J2EE: A Platform for Enterprise Web Services
Overview
Approximately 70 percent of Global 2000 enterprises use Java technology, and by the year 2006 the number of professional Java developers worldwide is projected to grow to 2.5 Million (Gartner). Adopted by the open-source community and employed by industry goliaths, Java and its enterprise component framework, Java 2 Enterprise Edition (J2EE), has emerged as a leading component architecture for applications requiring agility, scalability and interoperability. In this whitepaper, we provide an overview of the J2EE architecture and its emergence as an enabling component of Enterprise Web Services, a key element of an intelligent Enterprise Architecture.
Introduction
The increased importance of technology in business strategy has forced organizations to gravitate toward more agile, flexible, and scalable methods for designing and implementing business applications. The simultaneous emergence of the Web and the increased attention to object and component development models has resulted in rapid adoption of distributed component architectures and their associated tools and platforms. Distributed component architectures provide the foundation and standards for invoking objects within one application from another application independent of application location. The applications could reside on the same server, different servers, or even in different organizations.
ViewPoints
The best known component models are Microsofts Distributed Component Object Model (DCOM) and J2EEs Enterprise Java-Beans (EJB). Figure 1 shows an example of the basic components of a component system: Software components, a standard interface, and common services.
Figure 1: The J2EE Component Model The Microsoft DCOM approach allows developers to use any programming language to build applications, but the applications themselves will run only on the Windows operating system. By contrast, J2EEs approach requires that applications be built using the Java programming language, though they can run on any operating system.
ViewPoints
allows each vendor to distinguish themselves by creating integration and add-ons to their product suite. A J2EE vendor also must provide application deployment and management tools, though these tools are not prescribed by the J2EE specification.
Figure 2: J2EE Platform J2EE unifies access to enterprise services such as transaction processing, database access, and messaging, through its enterprise service APIs. Containers provide access to each implementation of a specific device via the APIs. Again, the interfaces defined by the J2EE platform specification and the implementation are left to the vendor. J2EE specification defines several major elements of the architecture: J2SE Java 2 Standard Edition. Containers and Application Servers Runtime environments that provide services to J2EE components. J2EE Components Application constructs whose lifecycles are managed by containers. Enterprise Service APIs and J2EE Connector Architecture Integration facilitators to the Enterprise Information System (EIS) tier and other middleware.
ViewPoints
J2SE Java 2 Standard Edition
J2SE is, in the simplest terms, the Java development environment. It includes the Java Virtual Machine (JVM), the core and integration APIs, user interface toolkit, and development toolkit.
Figure 3: J2EE Application Server Functional Model The JVM is the runtime engine that interprets Java Byte Code into platform specific instructions, facilitating platform independence and modularity. Core and integration APIs include data structures, network communications, database and localization. Connectivity, I/O, and internationalization.
ViewPoints
may be composed of a variety of internal applications. These Application Servers generally provide core object and session management functionality through the use of Object Containers.
Figure 4: J2SE Model A J2EE application server vendor typically implements the J2EE server-side functionality using an existing transaction processing infrastructure in combination with J2SE technology. An application server is an environment for containers, providing runtime services such as clustering, fail-over, load balancing, and inter-container communication.
ViewPoints
the business logic. Simple JSP tags can be developed improving reuse and transparently adding complex functionality to the presentation layer.
Figure 5: J2EE Logical Architecture One of the richest components of the J2EE framework is the Enterprise JavaBean (EJB). The EJB component model simplifies the development of middleware applications by providing automatic support for services such as persistence, transactions, security, database connectivity, and more. EJB is a distributed component model for developing portable, distributable, transactional, and scalable components existing over heterogeneous J2EE servers and operational environments. More simply, EJBs are a reusable bundle of business logic. Just as JSPs allow the separation of application and presentation logic, EJBs allow separation of application logic from system-level issues, allowing the developer to concentrate on the business domain issues rather than system programming. An EJB container manages the lifecycle of an EJB and shields the bean developer from issues including transactions, security, scalability, concurrency, communication, resource management, persistence, error handling, operating environment, and independence. Enterprise JavaBeans implement security through declarative access control. Access is granted based on configured security roles defined within the EJB container. The application server will provide deployment tools that map these abstract roles to users or groups of users that actually exist in the enterprises security environment. For example, the fund_administrator role might be mapped to everyone who is a member of the Windows security group Fund Manager. In this example, only members of the Fund Manager group may call an EJB business method with a method permission granted to the Fund Manager group. At a high level, there are three varieties of Enterprise JavaBeans entity beans, session beans, and messagedriven beans.
ViewPoints
Entity, Session, and Message-Driven EJBs
Entity Beans are persistent objects that are object-oriented representations of data in a database. Like a database, multiple clients can access it simultaneously. An entity bean might represent an account, product or person. The lifespan of an entity bean is exactly as long as that of the data it represents and the bean is logically the single point of access for that data. EJB containers can manage the process of saving and restoring entity bean state; this is known as containermanaged persistence (CMP). Alternatively, developers can control the beans persistence themselves; this is known as beanmanaged persistence (BMP). CMP promises large boosts in productivity and performance eliminating the need for developers to write and maintain SQL. Session beans encapsulate business logic or workflow and may be stateful or stateless. Stateful session beans can keep data between client accesses, a transient object such as a shopping cart. Stateless session beans may be used to implement a specific service such as a quick database update and have request-scope, basically a distributed static method call. Session beans execute on behalf of a single client. The Enterprise JavaBeans 2.0 specification added a new type of EJB, called a message-driven bean, which can act as a listener for Java Message Service API (JMS), processing messages asynchronously. A message-driven bean is similar to a stateless session bean, though it is exclusively as a boundary object, in that it is an entry point into the business logic or middle tier. The EJB specification is designed for the task of representing distributable business objects without making the business-logic developer provide system level services. Though EJBs may be overkill for the average dynamic Web-based application, any enterprise level architecture will benefit from writing business logic as EJB components, opening up new possibilities in developer productivity, application deployment, performance, reliability, and reusability.
ViewPoints
RMI The Remote Method Invocation allows methods to be called on remote, distributed Java objects as if they were local. It is the primary mechanism used by the Enterprise JavaBeans framework for inter-process method invocation. RMI-IIOP An extension of RMI but over Inter-ORB Protocol that allows you to define a remote interface for OMG CORBA objects and invoke methods through JavaIDL.
Figure 6: Integration, Old and New. The J2EE Connector Architecture (JCA) is the standard architecture for connecting the J2EE platform to heterogeneous Enterprise Information Systems (EIS). By defining a set of scalable, secure, and transactional mechanisms, the J2EE Connector architecture enables the integration of EISs with application servers and enterprise applications. JCA defines the following contracts between the application server and the application to be integrated: A security contract, so that the J2EE application server can securely access the external application to be integrated A performance contract, able to pool connections with the application to be integrated, to optimize performances A transactional contract that will enable the external application to participate in a distributed transaction. Though JCA is still in its infancy, tremendous progress has been made toward standardizing interface connectivity to enterprise resources. Before JCA, EIS integration was done as a specific point-to-point implementation or facilitated by a third party, proprietary integration broker. These implementations are
ViewPoints
mostly based on message-oriented or ORB middleware and offer no standard support for distributed transactions or connectivity. JCA promises standard interface connectivity and the ability for each resource to participate in distributed transaction.
10
ViewPoints
References Gartner, Leading Programming Languages for IT Portfolio Planning. 27 cx September 2002. J2EE 1.3 Specification EbizQ, Which Technology for Tomorrows EAI?, by TechMetrix Research 3/18/02 PWC Technology Forecast 2001-2003 PWC Technology Forecast 2002-2004 Figure 2 (Source: PWC Technology Forecast 2001 2003) Figure 3 (Source: Sun, 2002) Figure 4 (Source: PWC Technology Forecast 2001-2003 Figure 6 (Source: ebizq.net)
11