1.5. J2EE 1.4: The Platform for Web Services

This section briefly describes the entire J2EE platform, providing an overview of the technologies that are part of the platform and the platform's benefits. The J2EE 1.4 platform, while it introduces new technologies for Web services, also builds upon its earlier technologies for its Web services support.

For more complete coverage of the earlier platform technologies, you should refer to the previous book in the Java BluePrint's series, Designing Enterprise Applications with the J2EE Platform, Second Edition (Addison-Wesley) and the Java BluePrints Web site: http://java.sun.com/blueprints/. (See “References and Resources” on page xx.)

1.5.1. J2EE Platform Overview

The J2EE platform is designed to provide server-side and client-side support for developing Web services and distributed, multi-tier enterprise applications. Let's briefly examine the main concepts underlying the architecture of the J2EE platform. (Readers familiar with the J2EE platform may want to skip this section.)

  • Multi-tier model— The J2EE platform is architected to facilitate the deployment of multi-tier distributed applications and Web services. The platform defines different tiers, including a client tier, one or more middle tiers, and a back-end tier. It also defines a standard way for these tiers to communicate with each other. Because applications can communicate in a standard way, it is possible for an application's logic to reside in different tiers. Thus, applications can be deployed across different tiers in a distributed manner. Furthermore, the platform's multi-tier model enables various parts of an application to run on different systems. Each tier may also be assigned different and distinct responsibilities. This multi-tier development model also enables the platform to provide rich support to a wide variety of clients. The platform supports browser clients, wireless clients, rich Java-based GUI client, even non-Java clients.

  • Component-based development— The J2EE platform supports component-based development of applications and services. The portions of application logic that reside on separate tiers can make use of the different components provided by the platform for each tier. Such component-based development encourages reusability, since components are discrete modules that can be reused by virtually any other component when needed. The platform can support a range of components for representing application business logic. This type of component-based development model also enables apportioning development responsibilities by skill set; that is, assigning different and distinct responsibilities to various developers based on their skill set. Such division by skill set helps to efficiently use developer skills.

  • Container-based component management— To ensure that the components interact in a standard way, the platform introduces the concept of container-based component management. Components run within containers, which are standardized runtime environments that provide specific services to components and thus ensure application portability across platform implementations. In such a managed environment, containers interpose on all method calls and apply their services, which include standard session management, automated and declarable support for database transactions, security, standardized access to EISs, standardized deployment of applications (including the means to modify application behavior at deployment), and so forth. Components can expect these services to be available on any J2EE platform from any vendor. Along with this emphasis on standardization, the J2EE platform still remains open and flexible so that vendors can provide their own value-added support without compromising the portability of the application.

  • Support for the J2EE standard to promote portability— The J2EE standard, which is defined through a set of related specifications—the Enterprise JavaBeans specification, the Java Servlet specification, the JavaServer Pages specification, Java API for XML Based RPC specification, among many others—define and ensure a platform architecture that enables development of distributed, portable, and interoperable enterprise applications and Web services. In addition to the specifications, several other technology deliverables support the J2EE standard, including the J2EE Compatibility Test Suite, the J2EE reference implementation, and the J2EE SDK. The J2EE Compatibility Test Suite (CTS) helps maximize the portability of applications by validating the specification compliance of a J2EE platform product. The J2EE reference implementation, a complete implementation of the J2EE standard provided by Sun Microsystems, represents an operational definition of the J2EE platform. It is used by licensees as the “gold standard” to determine what their product must do under a particular set of application circumstances. It is the standard platform for running the J2EE Compatibility Test Suite, and it can be used by developers to verify the portability of an application. The J2EE reference implementation is available in both binary and source code form.

  • Support for the WS-I standard for interoperability— The Web Services Interoperability Organization (WS-I) promotes Web service interoperability across development platforms, operating systems, and programming languages, especially with the WS-I Basic Profile, which the J2EE 1.4 platform supports. Ensuring interoperability and portability starts with the specifications themselves. The J2EE 1.4 platform includes specifications and technologies that support Simple Object Access Protocol (SOAP), Web Services Definition Language (WSDL), and Universal Discovery, Description, and Integration (UDDI) specification. The platform includes technologies that enable standardized use of Web service specifications within the Java platform: JavaTM API for XML-Based RPC (JAX-RPC), Web Services for J2EE (JSR-109), SOAP with Attachments API for Java (SAAJ), Java API for XML Registries (JAXR), and Java API for XML Processing (JAXP).

1.5.2. J2EE Platform Benefits

The J2EE platform, with features designed to expedite developing distributed and interoperable applications, offers Web services application developers these benefits:

  • Simplifies architecture and development— The component-based J2EE development model enhances application development productivity because the components map well to the desired functionality of the application and service to be developed. Using tools, developers can configure application behavior at assembly or deployment, as required, knowing they can rely on the standardized interaction between components and the standard services provided by the container for the component.

  • Ensures support for emerging Web service standards— The J2EE platform continues to evolve its support for Web service standards and the WS-I Basic Profile. This ensures that application logic, whether new logic or enhancements to existing logic, developed using the standardized J2EE components can easily be exposed as Web services.

  • Ensures the development of portable and interoperable services— The J2EE platform, since it supports both common J2EE and WS-I standards, ensures not only that applications are portable across J2EE implementations, but also that services are interoperable with any Web service implemented on any other platform that conforms to WS-I standards.

  • Allows for integration with existing information systems— The J2EE platform provides industry-standard APIs, such as the J2EE Connector architecture, the JDBC API, Java Message Service, among others, for accessing EISs. Coupling these APIs with its support for Web services, the J2EE platform provides an excellent way to integrate existing EISs and make their data available to clients on heterogeneous platform environments.

  • Is scalable to meet demand variations— J2EE containers provide a mechanism that supports simplified scaling of distributed applications with limited application development effort. J2EE containers provide transaction support, database connections, life cycle management, and other services that are both scalable and require no code from application developers.

  • Provides a flexible security model— The J2EE security model is designed to be flexible, allowing component developers to declaratively specify component security requirements. Both Enterprise JavaBeans technology and Java Servlet APIs also provide programmatic security control.

In short, the J2EE standards and the J2EE brand have created a huge marketplace for servers, tools, and components. The J2EE brand on a server product ensures the consistent level of service fundamental to the goals of the J2EE platform. The J2EE standards encourage a lively marketplace for tools and components. Based on past experience coupled with the industry momentum behind Web services, all leading enterprise software vendors are expected to participate in the marketplace for J2EE 1.4 products.

1.5.3. J2EE Platform Technologies

The J2EE platform consists of technologies that support the development of distributed enterprise applications and services. These technologies fall into three broad categories: components, service, and communication. Figure 1.2 shows how these technologies interrelate. This section provides a brief overview of the J2EE 1.4 platform technologies. Refer to Chapter 2 for a more detailed discussion of these technologies.

Figure 1.2. J2EE 1.4 Platform Architecture


1.5.3.1. Component Technologies

Developers use the platform's component technologies to create the essential parts of an enterprise application and a Web service, such as the business logic of the service. The approach of using component technologies to develop the essential parts of a service keeps development modular and promotes the reuse of modules. The various component technologies of the J2EE platform are as follows:

  • Client component— The platform provides support for different types of clients to interact with components on the server side. Applet clients are Java-based clients that usually run from within a Web browser and have full access to the features of the J2SE platform. Application clients (often referred to as stand-alone clients) execute in their own containers and have full access to J2EE platform services such as JNDI lookups, asynchronous messaging, and so forth. These clients can directly interact with the Web and EJB components on the server-side of the application.

  • Web component— Web components provide a response to a request received via HTTP. The J2EE platform defines two distinct Web component types. Servlet components extend the functionality of a Web server in a portable and efficient manner. With servlets, developers can map a set of URLs to a set of servlets. As a result of such mapping, an HTTP request to one of the URLs invokes the mapped servlet, which in turn processes the request and returns a response. Servlet components can also be exposed as Web services. JSP components, as well as servlet components, enable the generation of dynamic content.

  • Enterprise JavaBeans component— Enterprise JavaBeans (EJB) components are designed specifically with business logic in mind. EJB components are scalable, transactional, and secure. Session bean components usually provide services to a single client, and their state cannot be recovered after a server crash. Furthermore, stateless session bean components can be exposed as Web services. Entity bean components are the object representation of data maintained in a data store. These components manage persistent data, either managing the persistence on their own or depending on the container to manage their persistence. Message-driven bean components enable clients to access business logic contained within enterprise bean components in an asynchronous manner. A timer service enables the implementation of timed operations.

Using these component technologies for implementing an application or service ensures the standardization of the application or service. Such standardization furthermore enables the reusability and portability of the application and service. Because they address different aspects of an enterprise application or service, using these components helps to divide development into different skill sets and make efficient use of different skills.

1.5.3.2. Platform and Container Services

The J2EE platform component technologies—the client, Web, and EJB components—depend on the support of the J2EE container to function properly. The J2EE platform standard, to ensure that components are portable, requires a conforming platform provider to make certain services available. Enterprise applications and Web services built with portable components and standard services are themselves assured of portability. Among the platform's required services are:

  • Naming service— A naming service allows symbolic access to EIS resources and components within a naming environment. These components can be customized when assembled or deployed without requiring changes to the look-up source code.

  • Deployment service— A deployment service allows changes to component behavior (such as transaction requirements and security requirements) at deployment without the need to change a component's source code.

  • Transaction service— A transaction service frees the component developer from having to include code to handle such transactional issues as multi-user access and failure/recovery. A transaction service allows the transaction requirements for components to be specified when they are assembled.

  • Security service— A security service ensures that components and resources are accessed by only those authorized for access. In addition, a security service provides authentication and confidentiality, among other services, for users.

1.5.3.3. Communication

The J2EE platform, in addition to specifying component technologies and platform services, also requires a set of standard communication technologies. These communication technologies bring the platform's components and services together, making the J2EE platform an integrated, standard platform for developing portable, interoperable enterprise applications and Web services.

  • Internet protocols— The J2EE platform supports such standard, common Internet protocols as TCP/IP, HTTP, SSL, and so forth. These Internet protocols enable communication between components and between components and their clients.

  • Remote Method Invocation (RMI) protocols— The J2EE platform supports the Java RMI. Java RMI relies on the Remote Method Invocation APIs, which use Java language interfaces to define remote interface objects. The platform uses IIOP to turn local method invocations into remote method invocations.

  • Messaging technologies— In addition to its support for these Internet and RMI synchronous protocols, the J2EE platform supports technologies that enable asynchronous communication. Examples of these technologies are the Java Message Service API and the JavaMail API.

  • Web service technologies— The J2EE platform also supports Web service-specific technologies and protocols that, along with the already mentioned technologies and protocols, standardize communication between J2EE components and J2EE clients. With the advent of Web services, which improve interoperability with non-Java clients, the J2EE platform supports Web service standards such as SOAP and UDDI using technologies such as Java API for XML-based RPC, Java API for XML Registries, and so forth.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset