WebSphere

Subscribe to WebSphere: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get WebSphere: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


IBM WebSphere software products Authors: Yeshim Deniz, hyper filter, Timothée Bensimon, XebiaLabs Blog, Javier Paniza

Related Topics: Java EE Journal, WebSphere

J2EE Journal: Article

Professional IBM WebSphere 5.0 Application Server - Excerpted from Chapter 2: The WebSphere Programming Model

Professional IBM WebSphere 5.0 Application Server - Excerpted from Chapter 2: The WebSphere Programming Model

Written by IBM WebSphere experts, this book details how to develop, deploy, and manage enterprise applications for version 5.0 of IBM WebSphere Application Server. Over the course of the book, a large-scale e-commerce application is developed, demonstrating the use of WebSphere Application Developer Studio. The book also addresses other enterprise-level issues such as the functionality of the application server, deployment topology, and server administration. The following excerpt from Chapter 2 focuses on the WebSphere programming model.

We examine many aspects of the WebSphere programming model in this book. However, notwithstanding the breadth of coverage included in this book, the total WebSphere programming model is larger than we can hope to address between a single pair of covers. Fortunately, the majority of the WebSphere programming model is based on open standards, and so, a great deal of what we don't cover here can be learned from other readily available sources - the most important of which is the Java web site at: http://java.sun.com/. Other useful books on the general topic of J2EE programming include:

  • Professional Java Server Programming J2EE 1.3 Edition, Wrox Press, ISBN: 1-86100-537-7
  • J2EE Design Patterns Applied, Wrox Press, ISBN: 1-86100-528-8
  • Expert One-on-One: J2EE Design and Development, Wrox Press, ISBN: 1-86100-784-1
To help put WebSphere in perspective, we provide an overview of the entire programming model in this chapter:
  • We begin with a discussion of the basic models of computing supported by the WebSphere programming model.
  • We then proceed with a discussion of the classic J2EE roles and some thoughts about additional roles that can contribute to the development and deployment of applications in your enterprise. This will include a discussion on how these roles play into the overall programming model process.
  • We follow with an overview and introduction to the additional programming facilities introduced by WebSphere that go beyond the J2EE standard, including the web services programming model.
This chapter will also outline the APIs included in the WebSphere programming model. It will provide some perspective on the value of the functions intrinsic to the WebSphere programming model - hopefully offering you some new ways of thinking about your business applications.

We will, in this discussion, provide some insight on which APIs are considered strategic, which are supported across all of the WebSphere platforms and editions, and which are restricted. We will introduce the idea of privileged code to gain access to otherwise restricted elements of the programming model. By the time you've finished reading this chapter, you will have a base line on the WebSphere programming model, and be better prepared to understand the programming concepts and details presented through the rest of this book.

Models of E-Business Computing
WebSphere is a J2EE-compliant application server supporting the entire breadth of the J2EE specification. WebSphere version 5.0 is certified at the J2EE 1.3 level, and as such, J2EE is at the heart of the programming model. Given the platform portability premise of Java (and J2EE itself), there is a good chance that you will be able to port your conforming applications to WebSphere with little effort.

However, that only tells a part of the WebSphere story. As programmers, our needs for information computing are varied, dynamic, and growing. Most computing scenarios today have to address a variety of issues: end-user delivery channels, development methodologies, business-enablement approaches, legacy protection, and fulfillment goals. WebSphere has excellent capabilities for supporting many of these requirements. To understand these, it would be best to start with a basic understanding of the key models of computing and how WebSphere addresses each of these. Then, you can combine this knowledge to form a solution tailored to your specific situation.

WebSphere provides support for four basic models of e-business computing:

  • Multi-tier distributed computing
  • Web-based computing
  • Integrated enterprise computing
  • Services-oriented computing
The fundamental structures of application design enable distributed computing for different business and organizational scenarios. Most applications will eventually exploit a combination of these models to solve the needs of the environment in which they will be used. The WebSphere programming model covers the full span of each of these models.

If you are already familiar with the fundamentals of distributed computing, component programming, shared and reusable parts, business process management, and service-oriented architecture then you might like to skip ahead a bit. More so, if you're already familiar with J2EE and the core premise for WebSphere, then skip this section - move on to The WebSphere Development Model section. If, on the other hand, you're not sure about these topics or a brief refresher might cement the issues in your mind then read on. Our view is that to best understand WebSphere you need to understand the types of computing models it is designed for.

Multi-Tier Distributed Computing
Multi-tier distributed computing is what motivated the development of many of the core server technologies within WebSphere. The idea of component-based programming is to define reusable and shared business logic in a middle-tier of a three-tier distributed application [see Figure 1].

 

The value of three-tiered distributed computing comes from first structuring the application with a clean separation between the logic elements (presentation, business, and data) and then leveraging the boundaries between these elements as potential distribution points in the application, allowing, for example, the presentation logic to be hosted on a client desktop, the business logic in a middle-tier, and the data logic on a traditional data centre.

Placing the presentation logic on the user's desktop has the benefit of enabling a rich interaction model with the end user. Placing the data logic in the traditional data center allows tight, centralized control over the data and information assets of the enterprise. Placing the business logic in a middle-tier allows for the exploitation of a variety of computing systems and better reuse and sharing of common computing facilities to reduce the cost of ownership that is commonly associated with expensive thick clients. It also means that you don't have to manage large quantities of application logic in the desktop environment.

The boundary between each tier represents a potential distribution point in the application, allowing each of the three parts to be hosted in different processes or on different computers. The J2EE programming model provides location transparency for the business logic, allowing you to write the same code irrespective of whether the business logic is hosted over the network or is in the same process. However, you shouldn't let this trick you into treating your business logic as though it is co-located in the same process - notwithstanding the tremendous improvements we've seen in networking technologies, communication latency will affect the cost of invoking your business logic and you should design your application keeping in mind that such boundaries can carry this expense.

Even if you don't distribute your application components across a network, you can still benefit from the boundary between the tiers. Every boundary that you are able to design into your application becomes an opportunity to "plug-replace" other components. Thus, even nominal distribution of these components can improve the ease of maintenance of your application. It also becomes an opportunity for the runtime to spread workload over more computing resources (we'll discuss this in detail in Chapter 12).

Through J2EE, WebSphere provides a formalized component architecture for business logic. This component technology has several key benefits to application development. Foremost, the component model provides a contract between the business logic and the underlying runtime. The runtime is able to manage the component. This ensures the optimal organization of component instances in memory, controlling the lifecycle and caching of state to achieve the highest levels of efficiency and integrity, protecting access to the components, and handling the complexities of communication, distribution, and addressing (see Figure 1).

Secondly, the component architecture allows the client programming model to conform to well-established rules, which implies that distributed components are shared components - that is, the same component can be used by many different applications simultaneously [see Figure 2].

 

Finally, because the J2EE component model is designed around object-oriented principles, you are able to do a better job of modeling your business in the application design. This will help improve communication between you and your business end users - you can cast your application artifacts in terminology that they recognize, with behavior that is consistent with the conceptual model of the business they are trying to automate. We recommend that you exploit UML or some other standard modeling notation to define your basic business model design, and then use that model to generate the base J2EE artifacts in which you will implement that model. Rational Rose, for example, is one of several products that allow you to build a UML model, and then export that to a J2EE component implementation skeleton.

So, having a single, shared implementation and instantiation of business components in an environment where the developer doesn't have to deal with concurrency issues not only reduces the duplication of development effort, but also allows you to concentrate more on ensuring the correctness and completeness of your component implementation. It gives you more control over your business processes by ensuring that business entities are adhering to your business policies and practices - you don't have to worry that someone has an outdated or alternative implementation of your business model sitting on their desktop. We have all heard stories about loan officers giving out loans at the wrong interest rate with inadequate collateral because someone had out-of-date rate tables loaded in the spread-sheet. Shared business logic implementations help avoid these costly problems by encouraging fewer implementations of the business logic and therefore fewer opportunities for the business logic to get out of sync.

With the introduction of a component technology for business logic in a three-tiered distributed computing model, we immediately began to see design patterns for the composition of business objects. That is, businesses want to be able to form higher-level business concepts that aggregate previously independent elements of their business. Instead of a customer having multiple accounts, and therefore, multiple relationships with the business, the enterprise could bring together all the individual accounts for a given customer under a single customer object and thus form a better and more enhanced relationship with the business. The business logic could thus be structured in multiple tiers, ranging from general to more specific, all formulated under the same underlying component architecture.

From this was born the idea of multi-tier distributed computing, where the middle-tier of business logic could be composed of an arbitrary number of intermediate tiers all running on a common WebSphere J2EE platform architecture and thus ensuring consistency of programming, deployment, and administration [see Figure 3].

 

We should reiterate here that the multi-tiered distributed computing nature of component-based programming for business logic enables the integration of distribution points within your application design. It also defines a contractual boundary to your business components that can be leveraged to share your business logic components within many different applications, which in turn may be distributed. However, you don't have to distribute the components of your application to benefit from component-based programming. In fact, distributing your components introduces coupling issues that are not normally found in centralized application designs.

In cases where you know the latency of distributed communication between two components cannot be tolerated in your application design, you can instrument your component with local interfaces that will defeat distribution, but still retain the benefits of component-based programming.

Many of the benefits of component-based programming come from the separation of application logic from concerns of information technology. In particular, the J2EE component model enables a single-level-store programming model, whereby the issues of when and how to load the persistent state of a component are removed from the client.

The component model allows the runtime to manage the component in the information system. This same principle of management applies to object identity, transaction and session management, security, versioning, clustering, workload balancing and failover, caching, and so on. In many cases, the runtime has a much better understanding of what is going on in the shared system than any one application can ever have, and thus can do a better job of managing the component and getting better performance and throughput in the information system. Since WebSphere is a commercially available product, you can acquire these benefits for much less than it would cost you to create the same capability on your own.

About the BOOK
Professional IBM WebSphere 5.0 Application Server
by Rob High et al.
ISBN: 0-7645-4366-0
Publisher: John Wiley Publishing
List Price: $79.99

Reprinted with the permission of Wiley Publishing. For purchase, call 1-800-225-5945 or visit www.wiley.com

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.