Web services: you're no doubt starting to see a seemingly endless supply of magazine articles and books telling you how wonderful they are, and how they will revolutionize the way that you build software systems. Unfortunately, these publications rarely explain how you can look at your existing designs and identify the Web services that your applications can potentially offer. This series will teach you how to do just that.
This series of articles presents a process, based on the techniques presented in Designing Object-Oriented Software and expanded upon in Building Object Applications That Work (see Resources for links to these books and other recommended reading), for analyzing a traditional object design for the purposes of deploying it to a distributed environment. I've used this approach in the past for CORBA- and J2EE-based systems and am now using it to identify and build Web services systems in Java programming language. In my experience, the design process stays the same, even though underlying technologies change over time.
To help illustrate this process, I will refer to a fictitious case study, a simplistic e-commerce system called SWA Online, throughout this series of articles. This application is an online storefront that enables customers to place orders and have them shipped to their homes. Figure 1 presents a high-level analysis class diagram, using Unified Modeling Language (UML) notation, which shows the main classes and their interrelationships. It depicts the frontend, likely implemented as a collection of JavaServer Pages (JSPs), as a package with the stereotype of <<application>>. Similar applications for maintaining inventory and for shipping would exist but are not shown in this example. The other classes are the major business classes that make up this system; details for some will be shown in future articles in this series.
Figure 1. Initial class model for SWA Online

The SWA Online project team has decided to take a Web services approach because it wants a solution that is both scalable and very robust. The solution will be scalable because the team will be able to deploy each service to separate environments as required; it needs to be robust because the team wants the option to either extend its services to external organizations or to replace its systems with services offered by Web service providers (WSPs) at some point in the future. For the first release, the team intends to implement most of the Web services behind a firewall, a common strategy that many organizations use.
The process of identifying Web services in object-oriented designs
In order to derive a set of Web services from an object-oriented application, you need to identify domain packages -- high-level clusters of business/domain classes -- and the services that each package provides. These packages are then implemented using your technology of choice (for our example, we'll be using the Java platform) and deployed within your environment. In effect, you are distributing classes into these packages and then integrating them via Web services. Therefore, an important question to ask is, "What service(s) should each package provide to its clients?" To answer this question, this series will follow several steps, typically performed in an iterative manner, for identifying Web services from your object-oriented models:
- Simplify persistence and system classes.
- Simplify inheritance and aggregation hierarchies.
- Identify class contracts.
- Identify domain packages.
- Identify domain-package contracts.
- Define Web service interfaces.
In the next three installments of this series, I'll go into these steps in detail. You'll learn how to simplify your UML models, identify your domain packages, and define your Web services. By the end of this series, you should be able to effectively transform your existing models and object-oriented applications into Web services that are available to your business partners.
-
Building Object Applications That Work: Your Step-by-Step Handbook for Developing Robust Systems with Object Technology, Scott W. Ambler (Cambridge University Press, 1997)
-
The Object Primer, 2nd Edition: The Application Developer's Guide to Object Orientation, Scott W. Ambler (Cambridge University Press, 2001)
-
Agile Modeling: Best Practices for the Unified Process and Extreme Programming, Scott W. Ambler (John Wiley & Sons, 2002)
-
Designing Object-Oriented Software, R. Wirfs-Brock, B. Wilkerson, and L. Wiener (Prentice Hall, 1990)
- The Object Management Group's Website provides the latest specification for UML.
- Learn more about using VisualAge UML Designer.
- Once you've implemented your applications as Web services, you can list them in IBM's UDDI
version 2 registry.
Scott W. Ambler is a Practice Leader for Agile Development within the IBM Methods group. He develops process materials, speaks at conferences, and works with IBM clients worldwide to help improve their software processes. Scott is author of several books, listed on his Web site at www.ambysoft.com. Scott is also a recognized Ratonal Thought Leader, whose homepage may be viewed here.




