Table of Contents
Integrated
Design and Development Environment
Automatic
Creation of UML Models from Code
Best Practices
for .NET Development
Getting More
Return From Your Models
Flexible Team
Development and Configuration Management
Integrated
Use-Case Management (IUCM)
Welcome to the Rational® XDE™ Professional v2002 Release 2.1 - .NET Edition Evaluators Guide. This guide was created to help you evaluate Rational XDE Professional v2002 Release 2.1 - .NET Edition (Rational XDE or XDE for short) and outlines the unique values that Rational XDE brings to developers. Exercises in this guide let you experience the product first-hand. Each exercise is independent of the previous one and takes about 30 min to complete. For a better introduction to Rational XDE, we recommend you follow this guide sequentially.
This guide is divided into the following sections:
o Step by step directions and exercises for you to experience the key benefits.
We hope this guide is a convenient resource for learning about Rational XDE Professional .NET Edition.
Rational XDE has
been designed from the ground-up for developers as an eXtended Development
Environment (XDE). Fully integrated into
the Microsoft Visual Studio .NET Integrated Development Environment (IDE),
Rational XDE allows developers to design and code within a single environment,
avoiding the need to switch between different, non-integrated tools.
If you are familiar with the Microsoft Visual Studio .NET IDE, you will find the Rational XDE user interface very familiar. If this is your first exposure to the Microsoft IDE you may want to visit the appendix of this guide for an overview of the common windows you will be manipulating in the exercises.
Before installing Rational XDE, you must install Microsoft Visual Studio .NET. If you do not have a copy of Microsoft Visual Studio .NET, you may want to download the trial edition from http://msdn.microsoft.com/vstudio/productinfo/trial.asp or contact Microsoft to purchase your copy.
Installing Rational XDE
First ensure that your system complies with the system requirements for Rational XDE:
|
Operating
System |
Windows 2000 Professional SP2 or SP3, or Windows 2000 Server, or Windows 2000 Advanced Server, or Windows XP Professional, or Windows NT 4.0 Workstation SP6a |
|
Processor |
Pentium II-class processor,
450 MHz Recommended: Pentium-III class, 700
MHz |
|
RAM |
Minimum: 256 MB; Recommended: 512 MB |
|
Disk Space |
Minimum: 400 MB for installation directory; 50 MB
for workspace Recommended: 2-4
GB for workspace |
|
Video |
Minimum screen resolution:
800 x 600 pixels, 256 colors Recommended:
1024 x 768 pixels, 16-bit color |
If you do not already own Rational XDE Professional, you can download the evaluation software from our Web site or request a copy of the Rational Software Solution for Microsoft .NET Developers CD.
·
To download the evaluation software, go to http://www.rational.com/tryit/xde/dotnet.jsp.
Click Download Evaluation Software.
Scroll down until you see a
icon
·
To request the CD, go to http://www.rational.com/tryit/xde/dotnet.jsp#netcd.
Click on the
icon
To install the
Rational XDE evaluation software:
·
From the Web, click on the
icon.
·
Follow the directions to save the installation
software to disk.
·
Extract
the content of the ZIP file you saved to a temporary directory. Double-click on Setup.exe.
·
In the
Rational Software Setup wizard, click Next.
·
In the
Choose
Product screen, select Rational
XDE Professional .NET Edition and click Next.
·
Read
and accept the agreement. Click Next.
·
On the
Select
Configuration screen, provided
you do not have other Rational tools installed, you
may browse to select a different installation location than the default
directory. Click Next.
·
Click Next until you reach the last pane of the
installation wizard.
NOTE: The Rational XDE evaluation software
is controlled by NetQuartz software and requires an Internet connection. The
release version of Rational XDE does not have these dependencies.
NOTE2:
If
you have installed a product, which relies upon J-Integra by Intrinsyc Software
Inc., you may experience a conflict resulting in Rational XDE reporting errors upon startup. To avoid this, simply edit your system
environmental PATH variable and ensure that the entry \Program
Files\Rational\common is ahead of any J-Integra entry. After a system restart, you should be on your
way!
Getting Started
In this section, you will create a Microsoft Visual Studio .NET blank solution that will hold the projects created in the subsequent exercises.

You are
now ready to experience the power of Rational XDE! The
Rational XDE combines design and development into a
seamless, tightly integrated experience.
This eXtended Development Environment provides essential developer
capabilities that are fully integrated into the Microsoft Visual Studio .NET
technology, thereby providing one consistent look and feel and experience.
Modeling is now as much a part of your IDE as your
code editor, compiler and debugger. With
this combined environment, your primary development tools follow the same
menus, gestures, and usage metaphors, which accelerate your learning curve and
promote the use of design, code generation and code synchronization as a daily
function.
Ultimately, this leads to developing better software
faster!

Figure 1.
Design and development within one environment – Access code and model simultaneously.
In this section you
will experience the following key Rational XDE features:
·
Creating
model from code
·
Automatic
or manual code synchronization
While creating a simple C# application, you will see Rational XDE build the visual model for the application and you will use this model to understand how the application fits within the Microsoft Visual Studio .NET Framework. Along the way, you will also experience the effectiveness of Rational XDE to quickly change properties of multiple elements. Finally, you will experience the automatic synchronization in action by modifying your model and watching your code update and then by modifying your code and watching your model update.
4.5. Rename the
project DateAndTime and keep the default location. Click OK.

The DateAndTime project is added to the Test Drive Solution.
DateAndTime project



Creating UML Models from Code
13.
In the Solution Explorer, select the DateAndTime
project, and click on the Synchronize icon
.

DateAndTime model



Key Benefit
Rational XDE and Microsoft Visual Studio .NET work together using shared
technology and a tight integration to create a UML design model of your
application with just one click from within the Visual Studio .NET IDE. You can now visually model your code without
ever leaving your favorite development environment, making designing your
applications easier than ever.
Visualizing the .NET Framework Classes

Key Benefit
Through a visual model, Rational XDE helps you learn about the .NET
Framework and understand how your application uses the .NET Framework
components. By expanding your classes, you can quickly see which .NET Framework
components your application depends on.
Relationships between your application classes and .NET Framework
components help you visualize how your application uses these components. This information gives you quick access to
the system library details you need while building your application.
19.20.
Select Edit > Select All Shapes to
select all the shapes in the diagram.
20.21.
In the Properties view
located at the bottom right, scroll down to
the View section and enter 4000 for Height and 3000 for Width. Click away to effect the change on the
diagram.

NOTE: Only the
properties common to all selected elements are displayed.
Key Benefit
Rational XDE’s tight integration with Microsoft Visual Studio .NET provides
a seamless way to modify properties of multiple model elements in one gesture,
the same gesture that you use while you develop your software application.
21.22. Click on the
diagram tab
to give the focus to the diagram.
22.23.
Click the
Arrange All Elements icon on the
toolbar.
23.24. Change
the Zoom factor to 75%
for better viewing
24.25. Use
the cross hair
in the bottom right corner of the diagram to
view all classes with a bird’s eye view.
Cross
hair
![]()

25.26. Using the Ctrl
key, select three of the classes displayed in the Main diagram.
26.27. Click on the fill
color
icon on the main toolbar and select a new
color. The classes background change to
that color for easy and quick identification.

Key Benefit
With Rational XDE you can leverage formatting options, like colors, to make
your models easier to read and understand.
Viewing Code And Model Simultaneously
27.28. At the top of the
drawing area, select the
tab representing the code view for the Form1 class.

Key Benefit
You can customize your work area to see both the
visual model and your code at the same time, allowing you to work on either the
code or the model and see how your changes impact each area.

Key Benefit
Rational XDE conveniently takes you to the location in the code
that applies to your selection context.
Synchronizing Code and Model Automatically
Key Benefit
With Rational XDE, you can leave the burden of maintaining code and model
in sync to the tool. Turning auto synchronization on will then free you from the hassle of manually synchronizing your code
with your model. Additionally, Rational
XDE lets you to decide when synchronization occurs and how conflicts between
code and model are handled. Because
auto synchronization upon
each and every change can be distracting, you can turn it off until you
are ready to generate code from your model.

Key Benefit
Rational XDE provides multiple representations of model elements and
maintains them in sync at all times.


Updated
attribute signature Updated
operation signature
![]()

Key Benefit
With auto sync turned on, changes in your source code are automatically
updated in your model. Because Rational
XDE keeps the visual representation of your application current, you can work
the way you feel most comfortable, either in the model or in the source code,
without the hassle of having to manually synchronize the two.
Integrated design and development increases developers’ productivity by providing an extended development environment where code and model are kept synchronized at all times.
With Rational XDE, developers work the way they feel most productive, either in the model or in the code because Rational XDE handles the hassle of maintaining code and model synchronized. Developers simply specify how they want conflicts between code and model to be resolved and Rational XDE handles the rest!
Additionally, Rational XDE maximized your efficiency by allowing you to decide when to turn on automated synchronization. When you want to test a few designs or apply some patterns without committing the model changes to code, you simply turn off the auto synchronization option. You don’t have to wait for the tool to synchronize code and models. Other times when you don’t want to have to think about your code and model being out of sync, you turn on the auto synchronization option, and at any change, in model or code, will be automatically synchronized.
The tight and seamless integration of Rational XDE with Microsoft Visual Studio .NET makes modeling as much a part of the IDE as the code editor and debugger, which accelerates the learning curve and promotes the use of design, code generation, and code synchronization as a daily function. With Rational XDE developers use the same menus, gestures, and usage metaphors as in the Microsoft’s Visual Studio .NET IDE to effectively work on model elements.
The Unified Modeling Language (UML) is the
industry standard notation for software development. With this common language, communication is
better, development time is shorter, complex systems are more easily
understood, and designs are cleaner and more maintainable. However becoming proficient at UML can be
time consuming. To help developers learn
UML while they code, Rational XDE automatically generates the UML
representation of your code directly from your source files! The generated models are beneficial for
documenting your work, understanding complex projects through visualization and
harvesting your work for future reuse.

Figure 2. Learn UML While You Code – As developers work in
their code, XDE instantly reflects any changes in the corresponding UML model.
In this exercise you will use one of the examples that ships with Visual Studio .NET to experience the following key Rational XDE features:
· Code
visualization
· Model
references to the .NET Framework
· Learning
UML as you code
NOTE: Because the Visual Studio .NET samples do not typically get installed when installing Visual Studio .NET, you likely will be asked for your Visual Studio CD (or a network location from where you installed Visual Studio .NET) at the start of the exercise.
6.5. Click
on the
search result. At this time you may be asked
to locate the sample solution file. You
can either load your Visual Studio .NET CD or point to the network location
from which you installed
7.6. Click
and accept the default location of MyDocuments.
NOTE: This exercise has you copy the
sample files, rather than load them, to remain within one instance of Visual
Studio .NET. Loading the files would
invoke another instance of Visual Studio .NET, and running multiple instances
of Visual Studio .NET can become memory intensive.
8.7. Select
File >
Open Solution and navigate to the MyDocuments\samples\VCSharp\General\Scribble
directory.
11.9. In
the Solution Explorer, using the Ctrl key,
multi-select the three C# files: Scribble.cs, ScribbleDoc.cs, and ScribbleView.cs.

Key Benefit
Rational XDE is flexible enough to support model-code synchronization at the class, file, project or solution level. This allows you to quickly visualize only the code that interests you.
12.10. Click
the Synchronize icon
in the Solution Explorer toolbar.
13.11. Wait
for the synchronization to complete. Notice the synchronization icon
,
progress bar and status in the Rational XDE status bar. During synchronization, Rational XDE
automatically created a
Scribble model in the Model
Explorer and opened the model Main diagram (Scribble.mdx::Main).
14.12. In
the Model Explorer, expand the
Scribble namespace. Rational XDE has added four UML classes
(MainWindow, ScribbleDoc, ScribbleView and Stroke) from the Scribble C# code. It also added
references to the .NET Framework components
that are referenced by the Scribble project.
Visualizing Code with UML
15.13. From
the Model Explorer, drag the MainWindow class onto the
diagram.
16.14. On
the diagram, right click on MainWindow and select Add Related Shapes….
Key Benefit
When displaying relationships between elements, you can select the specific models to add elements to your diagrams, as well as the direction and type of the relationships between these elements and elements already on your diagrams. This level of flexibility allows you to visualize your code at the right level of abstraction, quickly and easily.
Understanding References to Visual Studio .NET Framework Classes
22.17. In
the
Main diagram, right click the ScribbleDoc class and select Add
Related Shapes…
25.19. Click
the Arrange All Elements icon.
Notice the System.Drawing
Pen
class is added to the diagram.
Key Benefit
Rational XDE creates a reference model for each .NET Framework component referenced in your project. By visualizing the relationships between your classes and the .NET Framework, these reference models make it easy to learn the .NET Framework classes as you develop code.
Assisted
Modeling
Now let’s add a C# property to your ScribbleDoc class so that you can query the class to determine if the associated document is currently the active document.
26.20. Use
the cross hair
to view the ScribbleDoc class on the diagram.
27.21. Open
the Toolbox
. If you do not see a Toolbox, select View
> ToolBox.
28.22. From
the Toolbox, click the
category in the Toolbox.
29.23. Click
on
and click ScribbleDoc on the drawing
surface.
The XDE Add C# Property dialog is displayed.

Key Benefit
Rational XDE accelerates your UML learning curve by leveraging what you already know, C#, Visual Basic.NET and ASP.NET. Drag and drop language specific elements from the Rational XDE C#, Visual Basic or Web Toolbox to create UML models using a vocabulary you already understand.
30.24. Enter
pActive
as the Property Name. Leave the Property
Access as public.
31.25. Select
bool
from the Property Type drop down list, as the form will either be
active or inactive.
Key Benefit
Rational XDE conveniently lists all C# primitive types, saving you time associated with correcting typing errors. User-defined types may also be typed into the edit box.
32.26. Check
the box Create field to store property value.
33.27. Enter bStatus as the Field Name. bStatus
will be a private variable. Click OK.
NOTE: notice on the diagram the bStatus variable and pActive property added to the ScribbleDoc class. C# properties
are represented in UML as stereotyped attributes (<<property>>);
‘+/-’ indicates the attribute visibility (public/private).
34.28. Right-click
ScribbleDoc
and select Synchronize.
35.29. Wait
until the synchronization process completes.

Key Benefit
The ‘Add C# Property’ and ‘Add Visual Basic Property’ dialogs provided in Rational XDE supplement the standard Visual Studio .NET dialogs with the ability to create a private field to store the value of the property internally. In this example, pStatus stores the active state of ScribbleDoc. This is especially useful when developing Web services where fields may only be accessed via methods. Get and set methods for the new property are also automatically included in the generated code.
Learn UML as you Code
NOTE: UML provides 4 options for Visibility: PUBLIC, PROTECTED, PRIVATE, and PACKAGE. These options map to language-specific keywords when code is generated from models.
Key Benefit
Rational XDE facilitates learning UML by visually representing UML properties on the diagram itself.
Key Benefit
Rational XDE helps you learn UML as it relates to the tasks you are doing, at your own speed. In the Code Properties view of Rational XDE you can modify your code using familiar language terms rather than UML. If you are comfortable using UML, you could accomplish these same tasks using the Properties window and modifying the UML-specific properties. In essence, Rational XDE facilitates learning UML by automatically mapping familiar language-specific terminology to UML terminology. In this exercise, the OwnerScope UML property was kept in sync with the equivalent C# static property.
Because learning a new notation can be a daunting and time-consuming task, Rational XDE provides language specific assisted modeling (for both C# ad Visual Basic .NET), which allows you to leverage your knowledge of your favorite language to learn the UML.
Visualizing your code in UML models helps you quickly understand the relationships and dependencies between your code and the .NET Framework components it uses. Rational XDE provides flexible options for expanding, arranging and navigating model elements so that you can instantly visualize specific areas of interest. You can accelerate your learning curve of the .NET framework by using this same functionality to manipulate visual models of the .NET assemblies provided by Rational XDE.
The combination of the Code Properties View, the Properties View and code generation help you learn UML as you code, making leaning UML a part of your developer day.
With the automatic generation of UML models from code, you become more productive and learn UML as you go, without any downtime.
Rational XDE’s support for Web
services allows you to visualize your existing systems, new applications and
the interfaces they will each require.
As a member of an IT organization, you
are rarely faced with the ease of developing an isolated application. A more typical scenario is that you are not
only concerned with the system you are building, but also with a number of
existing systems your organization already has developed, and how the new
system will fit into your overall system architecture.
Using Rational XDE’s support for Web
services, you can visualize the overall architecture, understand what
interfaces exist today and what new interfaces need to be created. The interfaces can be with legacy COBOL code,
Visual Basic or even a C# application created a few days ago. They can be written in native code or based
on industry standards like Web services.

Figure 3.
Creating Web services – When developing Web services,
Rational XDE creates stereotyped UML classes to represent the Web service
elements.
In this section you will learn how to do
the following with Rational XDE:
· Model Web
services with ASP.NET and Visual Basic.NET
· Model key client
relationships with the Web services
· Conveniently view
WSDL files as UML classes
Today, Web Services are used predominantly to interface with legacy systems developed with varying technologies, such as Visual Basic or COBOL. Web services provide a standard protocol using SOAP, WSDL and UDDI to interface between the same and different technologies rather than create language specific interfaces. In this exercise you will create a new web service that retrieves the current time. You will then update a legacy application, the DateAndTime application, to take advantage of your new web service.
NOTE:
Please ensure you have successfully completed the Integrated Design and
Development exercise before beginning this exercise. Also, if you are performing this
exercise for the second time, be sure to remove the existing TimeService Web
service by deleting the TimeService folder under your /Inetpub/wwwroot/ directory.

After the Create New Web dialog disappears, the Web service is created.

Creating a Web Service
7. In
the Solution Explorer, select the TimeService project and click the Synchronize
icon
.


Key Benefit
Upon synchronization of your Visual Studio Web
service project, Rational XDE creates two UML classes. The first class represents the XML Web
service entry point, the .asmx file, and is easily recognized by the
<<NETWebService>> stereotype.
The second class represents the actual implementation of the Web
service. Visual Studio .NET refers to
this as the ‘code behind’ file. Rational
XDE conveniently maintains a <<NETWebServiceProxy>> stereotyped
relationship between the Web service class and the code behind file. Using the UML class representations of these
Web service files, you can easily model Web service functionality and even
begin to create customized Web service patterns.
![]()
![]()


Congratulations! You have just created a Web service. Next you will test this new Web service.
Testing a Web Service

|
![]() |
![]()
25. Close both browser windows that were opened by this exercise.
Leveraging Web services in Your Legacy Applications
Previously you created a C# application, DateAndTime, to get the current date and time. You will now update this existing application to obtain the current date and time using your new Web service.
26.
In the Solution Explorer, right click on the DateAndTime project and select Add
Web Reference…
Key Benefit
Reviewing a WSDL XML document to determine Web service functionality can be a tedious task. Rational XDE conveniently displays the WSDL XML document as a UML class so that you can quickly identify and understand functionality available from the Web service. When you add a Web reference in Visual Studio .NET, Rational XDE creates two new UML classes. The first class represents the WSDL document. The second class represents the proxy class generated by Visual Studio .NET. Using the UML representation of the proxy class you can model client interactions with the Web service as if it were a locally available component
27. In the Address field, enter http://localhost/TimeService/Service1.asmx and hit Enter.
28. Click
the Add Reference button.
NOTE: In the Solution Explorer, notice that the DateAndTime project now includes a
Web reference to the TimeService Web service.

29. In the Solution Explorer, select the DateAndTime project and click the Synchronize icon.
30. In the Model Explorer, notice the update to the DateAndTime model.

31. In
the Model Explorer, right click the DateAndTime model file (
)
and select Add Diagram > Class.
Name the diagram TimeService.
32. Expand
the
namespace and drag the Form1 class (
)
onto the diagram.
33. Expand
the
namespace and drag the Service1 class (
)
onto the diagram.
34. From
the Toolbox, select the
Directed Association and drag from Form1 to Service1.

|
Name |
mTimeService |
XDE will generate a new member variable in Form1, mTimeService of type Service1. |
|
Initial Value |
new DateAndTime.localhost.Service1() |
XDE allows you to set the initial value of the variable. In this case you will use a fully qualified name to assign mTimeService to a new instance of the Service1 class, which implements your TimeService Web service. |

36. In the Model Explorer, select the DateAndTime model and click the Synchronize button.
37. Right click Form1 and select Browse Code. Notice the new member, mTimeService and its initial value is exactly what you specified in step 35.

38. In the Model Explorer, right click Form1 button1_Click() operation and select Browse Code.
39.

Replace the function body to invoke the Web
service call instead:
40. In
the Solution Explorer, right click the DateAndTime project and select Debug->Start
new instance.
NOTE: If you run into a namespace compile error, verify in step 35 above that your mTimeService member variable is
initialized as follows:
localhost.Service1 mTimeService = new
DateAndTime.localhost.Service1();
41. Click on the DateAndTime application button to see your Web service in action. Close the application.
42. Close the windows associated with the DateAndTime project.
Congratulations! You just integrated a Web service into your
existing application using Rational XDE.
Rational XDE helps speed your learning and adoption of Web services, by reverse engineering a WSDL XML document into a UML class to quickly identify and understand Web service functionality. When creating Web services in Visual Studio .NET, Rational XDE creates UML classes to represent the .asmx file as well as the ‘code behind’ implementation file and maintains a stereotyped relationship between them. Using these UML classes, you can model Web services as you would any other component of your application.
You can even take advantage of customized patterns that incorporate your Web service. Patterns are the focus of the next exercise.
Integrating with legacy applications, learning new technologies such as Visual Basic .NET and adopting industry standards such as UML and Web services are just some of the challenges you face daily. Rational XDE facilitates each of these tasks so that your models can truly represent your system and all of its components, helping you meet the biggest challenge IT organizations face today: integrating disparate legacy systems.
Patterns are valuable reusable assets that jumpstart the development effort and leverage expertise so that you can finally experience reuse from previous project investments. Reusing development assets is also critical in jumpstarting any software development effort and ensuring quality designs.
Included in Rational XDE are well-known industry patterns, like the Gang of Four (see “Design Patterns: Elements of Reusable Object-Oriented Software”, Erich Gamma et al.). Additional patterns are available for download from the Rational Developer Network. But the true power of Rational XDE is in allowing you to visualize and leverage your own patterns.
In Rational XDE, patterns can be visually developed using the UML and a built-in pattern engine. Additionally, a user-friendly pattern wizard makes applying patterns easier than ever.
Patterns can also be extended by binding code templates, which eliminates the hassle of rewriting the same code over and over. This binding allows you to supplement patterns with code that is generated anytime you apply the pattern. This mechanism jumpstarts your coding efforts and improves the quality of your software by reusing proven code contained in code templates.