Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Deriving Web services from UML models, Part 2

Separating the wheat from the chaff through simplification

Scott W. Ambler, Prectice Leader, Agile Development, Rational Methods Group, IBM
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.

Summary:  The first task when identifying Web services is to conceptually simplify your object design. That way, as you move forward through the process, you only need to focus on its critical aspects.

Date:  01 Apr 2002
Level:  Introductory
Also available in:   Japanese

Activity:  5328 views
Comments:  

In Part 1 of this series, I reviewed a strategy for re-architecting an existing object-oriented design for an online storefront to take a Web services approach. This tip explores the first two steps of that process: simplifying persistence and system classes and simplifying hierarchies. These steps focus on conceptually simplifying the problem that you are tackling.

A common architectural strategy is to layer your application into different class types. I typically take a five-layer approach to building applications:

  • User interface (UI) classes encapsulate the elements, such as HTML pages, GUI screens, and printed/electronic reports, that make up the user interface for your system.
  • Business/domain classes, also known as entity classes, implement the fundamental domain types within your application, such as the Order and Customer classes in Figure 1.
  • Process classes implement complex business logic, such as that offered by a potential Web service, that pertains to several classes.
  • Persistence classes encapsulate access to your persistent stores, including relational databases, flat files, and object bases.
  • System classes encapsulate technical features, such as your approach to interprocess communication (IPC) or error logging.

This approach is covered in more detail in my book, The Object Primer 2nd Edition: The Application Developer's Guide to Object Orientation (see Resources).

Figure 1 and all other examples in this series are drawn from the SWA Online example; see Part 1 for details.


Figure 1. Initial class model for SWA Online
Initial class model for SWA Online

Step 1: Simplify persistence and system classes

For this purpose, to identify business-oriented Web services, you're going to choose to ignore the persistence and system layers for now. Your persistence layer may be implemented in one of several ways, including but not limited to hardcoded SQL, data access classes such as Java Data Objects (JDOs), a service such as EJB's container-managed persistence (CMP), or one or more Web services. Similarly, your system layer may be implemented as an API, a collection of wrapper classes, or as Web services. These objects exist and they're important, but for the sake of simplicity you're going to take their existence for granted so you can focus on the business side of things. Figure 1 does not include any persistence or system classes, but if it did, you would want to create a view of our model that did not show them.


Step 2: Simplify hierarchies

For the sake of identifying servers, inheritance and aggregation hierarchies can often be simplified. For inheritance hierarchies, a rule of thumb to follow is that if a subclass doesn't add a new contract, then it can effectively be ignored, and in general you can often consider a class hierarchy as a single class. In the Address classes outlined in Figure 2, the Territory class hierarchy could be simplified by ignoring State because it adds no new contracts. Furthermore, I'd be tempted to simply consider the entire hierarchy as one entity for now, since the remaining class, Country, only adds one contract, and frankly it's not all that exciting.


Figure 2. The Address classes
The Address classes

For aggregation hierarchies, you can ignore any "part classes" that are not associated to other classes outside of the aggregation hierarchy. In Figure 1, you can see that OrderContact can be ignored because Order is the only class to which it is associated. By collapsing aggregation and inheritance hierarchies, you simplify your model, making it easier to analyze when you define subsystems.

The result of your simplification efforts is Figure 3, which, as you can see, is a smaller model to work with than the original model in Figure 1.


Figure 3. Simplified class model for SWA Online
Simplified class model for SWA Online

Once your model(s) have been simplified, the next steps are to analyze your design and begin to reorganize it into packages. This is the topic of the next tip in this series. Until then, you should consider how to apply the techniques outlined here to your own object-oriented applications.


Resources

About the author

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.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=SOA and Web services
ArticleID=11658
ArticleTitle=Deriving Web services from UML models, Part 2
publish-date=04012002
author1-email=scott_ambler@ca.ibm.com
author1-email-cc=

Next steps from IBM

Rational Modeler is a free, UML 2.1 based environment that helps users to improve communication by specifying, visualizing and documenting their system, architecture and software designs using a standard graphical language.


Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers