21.07.2013 Views

Learning Technology FrameWork.pdf

Learning Technology FrameWork.pdf

Learning Technology FrameWork.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Learning</strong><br />

<strong>Technology</strong><br />

<strong>FrameWork</strong><br />

Ptech <strong>FrameWork</strong> 5.4 for Windows


Ptech Inc.<br />

160 Federal Street<br />

Boston, MA 02110<br />

Tel: (617) 443-1170<br />

Fax: (617) 443-1136<br />

www.ptechinc.com<br />

© 1996–1999 Ptech Inc.<br />

All rights reserved.<br />

Printed in the USA.<br />

DFD02-540-0000<br />

This document describes version 5.4 of Ptech <strong>FrameWork</strong> for Windows. By receiving<br />

this document, you agree that:<br />

● The information in this document is confidential and cannot be copied or<br />

reproduced without the written consent of Ptech Inc.<br />

● This document and its contents cannot be used in the manufacture or<br />

reproduction of the product described, and the delivery of this document does not<br />

constitute any right or license to do so.<br />

The software described in this document is furnished under license and can be used or<br />

copied only in accordance with the terms of that license. Ptech Inc. is not liable for<br />

errors in this document or for any damages that may occur in connection with using<br />

this material. The information contained in this document is subject to change without<br />

notice.<br />

Restricted rights notice: Use, duplication, or disclosure by the US Government is<br />

subject to the restrictions set forth in subparagraph (c) (1) (ii) of the Rights in Technical<br />

Data and Computer Software clause at DFARS 252.227-7013.<br />

Ptech and the Ptech logo are trademarks of Ptech Inc. CORBA is a registered<br />

trademark and Interface Definition Language (IDL) and Object Request Broker are<br />

trademarks Object Management Group, Inc. Forté is a registered trademark of Forté<br />

Software, Inc. Java is a trademark of Sun Microsystems, Inc. Orbix is a registered<br />

trademark and OrbixWeb is a trademark of IONA Technologies PLC. Windows is a<br />

registered trademark of Microsoft Corporation. All other trademarks, trade names, and<br />

service marks appearing in this document are the property of their respective owners.


About This Book<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

Contents<br />

Welcome! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii<br />

How to use this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii<br />

A note about the illustrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii<br />

Related documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii<br />

Customer support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .x<br />

What you’ll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1<br />

Starting <strong>FrameWork</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1<br />

Opening a KnowledgeBase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2<br />

Getting ready to explore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6<br />

<strong>FrameWork</strong> tour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7<br />

Clearing the deck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9<br />

Exploring existing folders and windows . . . . . . . . . . . . . . . . . . . .11<br />

Exiting <strong>FrameWork</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19<br />

Lesson 2: Creating Your First Use Case Diagram<br />

What you’ll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21<br />

Setting the stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21<br />

Setting up your work area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22<br />

Opening a new KnowledgeBase for your work . . . . . . . . . . . . . .22<br />

Organizing your work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24<br />

Creating a folder for your diagrams . . . . . . . . . . . . . . . . . . . .25<br />

Opening your first modeling window . . . . . . . . . . . . . . . . . . .26<br />

Contents<br />

iii


Contents<br />

iv<br />

Creating use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31<br />

If you make a mistake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32<br />

Creating composite use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34<br />

Creating actors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35<br />

Creating communication relationships . . . . . . . . . . . . . . . . . . . . . . .37<br />

Creating bidirectional communications . . . . . . . . . . . . . . . . . . . .38<br />

Creating one-way communications . . . . . . . . . . . . . . . . . . . . . . .39<br />

Creating subsystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41<br />

Saving your work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44<br />

Using naming conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

What you’ll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47<br />

Breaking down a composite use case . . . . . . . . . . . . . . . . . . . . . . . .47<br />

Building an employee acquisition diagram . . . . . . . . . . . . . . . . . . . .50<br />

Adding actors and communications . . . . . . . . . . . . . . . . . . . . . . . . .53<br />

Checking spelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

What you’ll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59<br />

Adding annotations to diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . .60<br />

Formatting text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62<br />

Aligning graphic objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64<br />

Bending connection graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67<br />

Repositioning text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70<br />

Resizing a graphic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71<br />

Lesson 5: Creating a Java Class Diagram<br />

What you’ll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73<br />

Creating the diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74<br />

Creating classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75<br />

Creating an association . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76<br />

Relating your first two classes . . . . . . . . . . . . . . . . . . . . . . . . . . .76<br />

Renaming the association ends . . . . . . . . . . . . . . . . . . . . . . . . .77<br />

Setting the multiplicity of an association end . . . . . . . . . . . . . . . .79<br />

Creating inheritance relationships . . . . . . . . . . . . . . . . . . . . . . . . . . .80<br />

Creating an incomplete partition . . . . . . . . . . . . . . . . . . . . . . . . .81<br />

Creating a generalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82


Adding more related classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84<br />

Creating an ordering association . . . . . . . . . . . . . . . . . . . . . . . . . . . .86<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

What you’ll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91<br />

Creating attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92<br />

Creating operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96<br />

Using forms to provide more information . . . . . . . . . . . . . . . . . . . . .98<br />

Viewing classes using compartment notation . . . . . . . . . . . . . . . . .102<br />

Lesson 7: Creating a Statechart Diagram<br />

What you’ll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107<br />

Creating the diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107<br />

Creating an initial state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109<br />

Creating states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110<br />

Creating transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113<br />

Creating final states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115<br />

Lesson 8: Exploring What You’ve Done<br />

Lesson 9: Generating Code<br />

What’s Next?<br />

What you’ll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119<br />

Navigating with forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119<br />

Navigating from fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120<br />

Using the form navigation toolbar . . . . . . . . . . . . . . . . . . . . . . .122<br />

Using queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124<br />

Running reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127<br />

What you’ll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133<br />

Using the Java Class Information form . . . . . . . . . . . . . . . . . . . . . .134<br />

Generating code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135<br />

<strong>Learning</strong> more about <strong>FrameWork</strong> . . . . . . . . . . . . . . . . . . . . . . . . . .137<br />

Additional <strong>FrameWork</strong> features . . . . . . . . . . . . . . . . . . . . . . . . . . . .138<br />

Contents<br />

v


Welcome!<br />

About This Book<br />

Welcome to <strong>Learning</strong> <strong>Technology</strong> <strong>FrameWork</strong>. This book is a<br />

tutorial that introduces you to object-oriented application<br />

development (OOAD) modeling with Ptech <strong>Technology</strong> or<br />

Enterprise <strong>FrameWork</strong>. By doing the exercises in this book, you’ll<br />

become familiar with the modeling process and the <strong>FrameWork</strong><br />

features that support it.<br />

To gain the most benefit from this book, you should be familiar with<br />

your Windows operating system.<br />

How to use this book<br />

You should start with Lesson 1 and proceed through the lessons in<br />

order. The modeling exercises build on each other. By doing the<br />

exercises in order, you’ll begin to develop a sense of the<br />

relationships between the models. You’ll learn how all the pieces<br />

come together to capture process requirements and implement<br />

them using the latest technology.<br />

About This Book<br />

vii


A note about the illustrations<br />

A note about the illustrations<br />

About This Book<br />

viii<br />

The <strong>FrameWork</strong> desktop and windows on your screen may differ<br />

slightly in appearance from the images in this book. The<br />

differences depend on the <strong>FrameWork</strong> product you’re using and on<br />

the environment in which you’re using it. For the purposes of this<br />

book, these differences are not significant.<br />

Related documentation<br />

Information on installing <strong>FrameWork</strong> for Windows is provided on<br />

an installation sheet distributed with the installation diskettes.<br />

Additional information about <strong>FrameWork</strong> and other Ptech products<br />

is available in:<br />

■ <strong>Learning</strong> Business <strong>FrameWork</strong> — This book contains a tutorial<br />

that introduces you to business process modeling with Business<br />

or Enterprise <strong>FrameWork</strong>. By doing the exercises in this book,<br />

you become familiar with the modeling process and the<br />

<strong>FrameWork</strong> features that support it.<br />

■ Using <strong>FrameWork</strong> — This book contains comprehensive<br />

information on using Ptech Business, <strong>Technology</strong>, and<br />

Enterprise <strong>FrameWork</strong> to capture your business processes and<br />

design the applications that support them. In this book, you’ll<br />

find both conceptual and procedural information on topics<br />

ranging from basic modeling techniques to sharing<br />

KnowledgeBase information.<br />

■ Modeling with Business <strong>FrameWork</strong> and Modeling with<br />

<strong>Technology</strong> <strong>FrameWork</strong> — These books describe the types of<br />

models directly supported by Ptech <strong>FrameWork</strong>. In these<br />

books, you’ll find information on the semantics and usage of<br />

each type of model, sample diagrams, and detailed information<br />

about the modeling tools and forms you use to create and modify<br />

model components.


Related documentation<br />

■ Generating C++ Code with <strong>FrameWork</strong> — This book explains<br />

how to generate C++ code from models you build using Ptech<br />

<strong>Technology</strong> or Enterprise <strong>FrameWork</strong>. This book also describes<br />

the C++-specific modeling tools and forms provided with<br />

<strong>FrameWork</strong>.<br />

■ Generating Java Code with <strong>FrameWork</strong> — This book explains<br />

how to generate Java code from models you build using Ptech<br />

<strong>Technology</strong> or Enterprise <strong>FrameWork</strong>. This book also describes<br />

the Java-specific modeling tools and forms provided with<br />

<strong>FrameWork</strong>.<br />

■ Generating CORBA IDL Code with <strong>FrameWork</strong> — This book<br />

explains how to generate Common Object Request Broker<br />

Architecture (CORBA) Interface Definition Language (IDL)<br />

code from models you build using Ptech <strong>Technology</strong> or<br />

Enterprise <strong>FrameWork</strong>. This book also describes the CORBAspecific<br />

modeling tools and forms provided with <strong>FrameWork</strong>.<br />

■ Customizing <strong>FrameWork</strong> — This book provides detailed<br />

information on using Enterprise <strong>FrameWork</strong> Professional to<br />

extend and customize the <strong>FrameWork</strong> modeling environment to<br />

meet the needs of your enterprise. Along with instructions for<br />

creating your own metamodels, diagram types, tool folders,<br />

queries, forms, and modeling contexts, this book includes an<br />

integrated set of examples that illustrate a customization<br />

scenario.<br />

■ Creating and Customizing ACG Templates — This book<br />

provides information that enables you to extend the reporting<br />

and code generation capabilities of the Ptech <strong>FrameWork</strong><br />

products to meet the needs of your enterprise. The ability to<br />

create and customize Ptech Abstract Code Generator (ACG)<br />

templates is included only in Enterprise <strong>FrameWork</strong><br />

Professional.<br />

About This Book<br />

ix


Customer support<br />

Customer support<br />

About This Book<br />

x<br />

Ptech offers its customers a variety of support services for<br />

<strong>FrameWork</strong> and its add-on products. In addition to the<br />

documentation and online help provided with the products, you can<br />

obtain information from the following sources:<br />

■ Formal training is available for all Ptech products.<br />

Experienced teachers can provide instruction tailored to your<br />

needs either at Ptech corporate headquarters or at your<br />

business site. For more information, please contact your Ptech<br />

sales representative at (800) 955-9345.<br />

■ The Ptech World Wide Web site provides access to up-to-date<br />

information on Ptech Inc. and the <strong>FrameWork</strong> family of products.<br />

You can browse the Ptech Web site at http://www.ptechinc.com.<br />

■ Technical support for Ptech products is available by telephone<br />

Monday through Friday between 9:00 a.m. and 6:00 p.m.<br />

Eastern time. To speak with a member of the Ptech Technical<br />

Support team, call (617) 443-1170 ext. 403. Alternatively, you<br />

can fax your questions to Ptech Technical Support at (617) 443-<br />

1136 or send email to support@ptechinc.com.


Navigating <strong>FrameWork</strong><br />

What you’ll learn<br />

This lesson contains basic information you’ll use in the lessons that<br />

follow. In this lesson, you’ll:<br />

■ Learn how to start <strong>FrameWork</strong><br />

■ Explore existing folders and diagrams<br />

■ Learn how to exit <strong>FrameWork</strong><br />

Starting <strong>FrameWork</strong><br />

<strong>FrameWork</strong> installation This book assumes that Ptech <strong>Technology</strong> <strong>FrameWork</strong> or<br />

Enterprise <strong>FrameWork</strong> is already installed on your PC.<br />

Note If <strong>Technology</strong> or Enterprise <strong>FrameWork</strong> has not yet been<br />

installed on your PC, see either the <strong>FrameWork</strong> installation<br />

instructions or your system administrator for assistance.<br />

1<br />

1<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

1


Opening a KnowledgeBase<br />

What you do To start <strong>FrameWork</strong>:<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

2<br />

Double-click on the <strong>FrameWork</strong> icon on your windows desktop.<br />

Opening a KnowledgeBase<br />

The <strong>FrameWork</strong> application<br />

window<br />

When <strong>FrameWork</strong> starts, the application opens like this:


Opening a KnowledgeBase<br />

The KnowledgeBase After you start <strong>FrameWork</strong>, you need to open the KnowledgeBase<br />

you want to use. A KnowledgeBase is a repository in which<br />

<strong>FrameWork</strong> stores objects, their interrelationships, and the rules<br />

and constraints that govern their creation and manipulation.<br />

You’ll open a KnowledgeBase that contains some sample models.<br />

This KnowledgeBase is stored in a file named DemoExample.pkb.<br />

What you do To open the DemoExample KnowledgeBase:<br />

1 On the File menu, select Open KnowledgeBase.<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

3


Opening a KnowledgeBase<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

4<br />

2 In the Open KnowledgeBase dialog box, open the Kbs<br />

subdirectory of the <strong>FrameWork</strong> installation directory if it’s not<br />

open already. Then select the DemoExample.pkb file and press<br />

the Open button.


Project Organizer<br />

Opening a KnowledgeBase<br />

When the KnowledgeBase opens, <strong>FrameWork</strong> looks something like<br />

this:<br />

Document<br />

Project Workspace<br />

Output Window<br />

Note<br />

Depending on the version of <strong>FrameWork</strong> you’re using, you<br />

may not see the Welcome Window displayed in the Project<br />

Workspace.<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

5


Getting ready to explore<br />

Getting ready to explore<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

6<br />

The <strong>FrameWork</strong> desktop features a user interface that makes it<br />

easy to manage your modeling projects. The display area of the<br />

desktop contains separate, dockable windows that present different<br />

types of information:<br />

■ The main window in the display area is your Project<br />

Workspace. This is the space in which you do your actual<br />

modeling work. The Project Workspace is the only window you<br />

cannot move.<br />

■ The window on the left is your Project Organizer. This<br />

window contains folders and modeling windows in tree<br />

structures called folder views. You use the folder view on the<br />

User page of the Project Organizer to organize your modeling<br />

work. The Base page shows the folders and windows that are<br />

common to all KnowledgeBases.<br />

■ The window at the bottom left is the Document window. In<br />

this window, you can enter textual information about<br />

<strong>FrameWork</strong> objects.<br />

■ The window at the bottom right is the Output window.<br />

<strong>FrameWork</strong> uses this window to display processing messages.<br />

You’ll see other types of windows on the <strong>FrameWork</strong> desktop as you<br />

continue with the lessons in this book.


<strong>FrameWork</strong> tour<br />

<strong>FrameWork</strong> tour<br />

To become familiar with some <strong>FrameWork</strong> basics, you’ll take a<br />

quick tour of an example contained in the Demo Example folder.<br />

To begin:<br />

1 On the File menu, select Close to close the Welcome Window (if<br />

it’s open).<br />

2 On the User page of the Project Organizer window, double-click<br />

on the Demo Example folder to open it.<br />

The Demo Example folder contains groups of diagrams<br />

representing structures and processes involved in the<br />

operations of a fictional company named SuccessTech.<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

7


<strong>FrameWork</strong> tour<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

8<br />

3 In the Demo Example folder, double-click on Road Map.<br />

<strong>FrameWork</strong> opens the Road Map window.<br />

The Road Map window presents a conceptual organization of<br />

the diagrams in the Demo Example.


Clearing the deck<br />

Freeing up screen real<br />

estate<br />

Clearing the deck<br />

As you can see, space is at a premium on your desktop. You<br />

probably can’t see as much as you’d like of the SuccessTech Road<br />

Map window. You’ll want to free up as much screen real estate as<br />

you can. This will maximize the area available to you for viewing<br />

diagrams in the Demo Example.<br />

Freeing up space simply means moving some toolbars and closing<br />

some of the windows that you don’t need at this particular moment.<br />

Think of it as simply tucking things away. They’re still there to<br />

help you when you need them. Meanwhile, the space you gain<br />

increases the area available in the Project Workspace.<br />

What you do To give yourself more space for exploring <strong>FrameWork</strong>:<br />

1 Open the View menu. Checkmarks next to the menu options<br />

indicate which <strong>FrameWork</strong> desktop elements are currently<br />

open.<br />

2 Click on the Output option to deselect it.<br />

<strong>FrameWork</strong> closes the Output window.<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

9


Clearing the deck<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

10<br />

3 Using the same procedure, close the Document window. With<br />

these windows closed and with <strong>FrameWork</strong> maximized, you<br />

should have enough room to look at the models in the example.<br />

Moving toolbars You can also free up space on the <strong>FrameWork</strong> desktop by moving<br />

toolbars (including the menu bar). You can change the location of a<br />

toolbar within the toolbar area. Alternatively, you can dock the<br />

toolbar elsewhere on the desktop or leave it floating. Docking a<br />

toolbar means setting it in place in the toolbar area or along an<br />

edge of a window frame on the <strong>FrameWork</strong> desktop. A toolbar is<br />

floating when it isn’t docked.<br />

What you do To move a toolbar:<br />

1 Click and hold anywhere on the toolbar background.<br />

Alternatively, if the toolbar is floating, you can click and hold in<br />

the toolbar title bar.<br />

Docked<br />

Floating<br />

2 Drag the toolbar to a new location and release the mouse<br />

button. If the toolbar is in the toolbar area or next to a window<br />

frame, <strong>FrameWork</strong> docks it automatically.<br />

Tip<br />

To dock a floating toolbar in the toolbar area, double-click in<br />

its title bar.


Exploring existing folders and windows<br />

Exploring existing folders and windows<br />

Now that you’ve cleared the decks and learned a little about<br />

manipulating the <strong>FrameWork</strong> desktop along the way, you’re ready<br />

to do a little exploring:<br />

1 In the Road Map window, double-click on the background of the<br />

Sales Use Case box located under USE CASE, STATECHART,<br />

& SEQUENCE DIAGRAMS.<br />

Tip<br />

If <strong>FrameWork</strong> opens an edit box for the Sales Use Case<br />

text, click outside the edit box to close it. Then try doubleclicking<br />

again on the background of the Sales Use Case box.<br />

<strong>FrameWork</strong> opens the Sales Use Case window.<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

11


Exploring existing folders and windows<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

12<br />

This window contains a use case diagram, which shows the<br />

types of interactions that can occur between a system and users<br />

of the system. Within a use case diagram, interactions are<br />

represented nonsequentially, placing the focus on their<br />

structure rather than their behavior. This focus enables the<br />

diagram to present a clear view of the requirements of an<br />

existing or proposed system.<br />

You’ll build your own use case diagrams in Lesson 2, “Creating<br />

Your First Use Case Diagram,” and Lesson 3, “Getting More<br />

Specific about Your Hiring System.”<br />

2 Double-click on the Qualify Lead graphic.<br />

<strong>FrameWork</strong> opens the Qualify Lead Use Case window.


Exploring existing folders and windows<br />

This is another use case diagram. It shows the details of the<br />

Qualify Lead composite use case. A composite use case is a<br />

use case that incorporates one or more other systems.<br />

3 Double-click on the Order Statechart graphic.<br />

<strong>FrameWork</strong> opens the Order Statechart window.<br />

This window contains a statechart diagram, which shows the<br />

changes an object undergoes during its life. An object changes<br />

from one state to another in response to internal or external<br />

events. The object in this statechart diagram is a sales order.<br />

You’ll create a statechart diagram in Lesson 7, “Creating a<br />

Statechart Diagram.”<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

13


Exploring existing folders and windows<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

14<br />

4 In the Project Organizer window, double-click on the Business<br />

Objects folder to open it.<br />

5 In the Business Objects folder, double-click on Order Business<br />

Objects.<br />

<strong>FrameWork</strong> opens the Order Business Objects window.


Exploring existing folders and windows<br />

This a class diagram that presents a static view of the objects<br />

involved in ordering products. A class diagram lets you describe<br />

information by defining types of objects, their properties and<br />

relationships to each other, and the operations that can be<br />

performed on them.<br />

You’ll build a special kind of class diagram in Lesson 5,<br />

“Creating a Java Class Diagram.”<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

15


Exploring existing folders and windows<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

16<br />

6 In the Order Business Objects window, double-click on the<br />

Compute Total Weight graphic.<br />

<strong>FrameWork</strong> opens the Compute Total Weight window.<br />

This window contains an operation diagram, which describes<br />

the interface of an operation defined in a class model. An<br />

operation diagram shows what class of objects an operation<br />

applies to and what class of objects it returns. It can also show<br />

methods and arguments for the operation.<br />

7 In the standard toolbar, click on the Go Back tool.<br />

<strong>FrameWork</strong> makes the Order Business Objects window active<br />

again. This is the last window you opened before the Compute<br />

Total Weight window.


Exploring existing folders and windows<br />

8 In the Order Business Objects window, double-click in the<br />

Order Distribution graphic.<br />

<strong>FrameWork</strong> opens the Order Distribution window.<br />

This is a distributed class diagram. It shows the objects that<br />

make up both sides of a client/server computing environment,<br />

including interface classes and their corresponding<br />

implementations.<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

17


Exploring existing folders and windows<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

18<br />

9 In the standard toolbar, click on the History tool.<br />

<strong>FrameWork</strong> opens the navigation history list. The checkmark<br />

indicates which window is currently active.<br />

10 In the navigation history list, select Road Map.<br />

<strong>FrameWork</strong> makes the Road Map window active again.<br />

11 Continue exploring on your own. For example, you can view<br />

other diagrams by double-clicking on the boxes in the Road Map<br />

window or on graphics in those diagrams.<br />

Tip<br />

An enclosed plus sign ( ) at the bottom left corner of a<br />

graphic indicates that double-clicking will open another<br />

window.<br />

Alternatively, you can open additional windows from the Project<br />

Organizer. As you can see, there are many other folders in the<br />

folder view. Open some of them up. Look around.<br />

12 When you’re done exploring, select Close All on the Window<br />

menu.


Exiting <strong>FrameWork</strong><br />

Exiting <strong>FrameWork</strong><br />

Exiting <strong>FrameWork</strong> ends your current working session.<br />

<strong>FrameWork</strong> always gives you the opportunity to save your work<br />

and the organization of your desktop when exiting. However,<br />

because all you’ve been doing up to this point is exploring, there’s<br />

no need to save your work now.<br />

To exit <strong>FrameWork</strong>:<br />

1 On the File menu, select Exit.<br />

2 In the message box that <strong>FrameWork</strong> displays, press the No<br />

button.<br />

Lesson 1: Navigating <strong>FrameWork</strong><br />

19


2<br />

Creating Your First Use<br />

Case Diagram<br />

What you’ll learn<br />

In this lesson, you’ll create your first use case diagram. In the<br />

process, you’ll learn how to:<br />

■ Set up and organize your work<br />

■ Open a new modeling window<br />

■ Use a modeling tool folder<br />

■ Create a use case diagram<br />

■ Save your work<br />

Setting the stage<br />

■ Use naming conventions<br />

2<br />

Modeling a hiring system The diagrams you’ll build in this tutorial are based on a hiring<br />

system. That is, they are based on the objects and operations<br />

involved in recruiting, interviewing, testing, hiring, and training a<br />

steady flow of qualified employees.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

21


Setting up your work area<br />

UML compliance The diagrams you’ll create are fully compliant with the Object<br />

Management Group (OMG) Unified Modeling Language (UML) 1.1<br />

suggested standard. <strong>Technology</strong> and Enterprise <strong>FrameWork</strong><br />

support all UML diagram types (including activity, collaboration,<br />

sequence, and instance interaction diagrams), although only a few<br />

are featured in this tutorial.<br />

Levels of modeling detail You’ll begin with a use case diagram that will represent the higherlevel<br />

usage scenarios for your hiring system and will serve to define<br />

the scope of the modeling project. This high-level diagram will<br />

describe the types of interactions that can occur between the hiring<br />

system and users of the system. In Lesson 3, “Getting More<br />

Specific about Your Hiring System,” you’ll model lower-level<br />

scenarios that provide more detail.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

22<br />

The basic components of a use case diagram are actors and use<br />

cases and the communications that occur between them. You’ll<br />

learn about these one at a time as you build your first use case<br />

diagram.<br />

Setting up your work area<br />

Before you begin modeling, you need to open a new KnowledgeBase<br />

in which you can save your work. A KnowledgeBase stores not only<br />

the models you build, but also the rules and constraints that govern<br />

their design. All the work you do in <strong>FrameWork</strong> is stored in a<br />

KnowledgeBase.<br />

You’ll also want to take care of some housekeeping details to create<br />

sufficient space in which to work.<br />

Opening a new KnowledgeBase for your work<br />

To open a new KnowledgeBase:<br />

1 Start <strong>FrameWork</strong> if you haven’t already done so.


2 On the File menu, select New.<br />

Opening a new KnowledgeBase for your work<br />

3 In the Name field in the New dialog box, type a name for the<br />

new KnowledgeBase. For example, type <strong>Learning</strong><strong>Technology</strong>FW.<br />

Then press the OK button.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

23


Organizing your work<br />

Organizing your work<br />

Lesson 2: Creating Your First Use Case Diagram<br />

24<br />

When the new KnowledgeBase opens, the <strong>FrameWork</strong> desktop<br />

looks like this:<br />

As you can see, the <strong>FrameWork</strong> desktop looks much the same as it<br />

did when you opened the DemoExample KnowledgeBase in Lesson<br />

1. However, you’ll notice that the User folder view in the Project<br />

Organizer window now contains only the Workspace Items folder<br />

and the Recycle Bin subfolder.<br />

Your work is best organized by creating folders in which you store<br />

your diagrams and, possibly, other folders. As with anything else, a<br />

little planning and a little discipline will help you get and stay


Organizing your work<br />

organized. This discipline will serve you well when you’re fully<br />

engaged in more extensive modeling projects.<br />

To illustrate this and set the pattern for your modeling efforts,<br />

you’ll create a folder in which you’ll store all the diagrams you<br />

create in this tutorial.<br />

Creating a folder for your diagrams<br />

Organizing diagrams<br />

visually<br />

<strong>FrameWork</strong> displays folders in a tree view to make it easier for you<br />

to visually organize and maintain your diagrams. When you<br />

expand a folder in the tree, <strong>FrameWork</strong> lists the windows and<br />

folders it contains. When you create a new <strong>FrameWork</strong> window,<br />

<strong>FrameWork</strong> places it in the currently selected folder or in the same<br />

folder as the currently selected window in the Project Organizer.<br />

What you do To create a folder for the diagrams you’ll build in this tutorial:<br />

1 In the folder view in the Project Organizer, place your cursor on<br />

the Workspace Items folder and click right.<br />

2 On the popup menu, select New Folder.<br />

<strong>FrameWork</strong> creates a folder named New Folder and puts the<br />

folder name in edit mode, giving you the opportunity to rename<br />

it.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

25


Organizing your work<br />

Lesson 2: Creating Your First Use Case Diagram<br />

26<br />

3 Type <strong>Learning</strong> <strong>FrameWork</strong> as the new name for the folder. Then<br />

press Enter to close the edit box.<br />

The Project Organizer should now look like this:<br />

You’re now ready to open your first modeling window.<br />

Opening your first modeling window<br />

Use case modeling window<br />

and tools<br />

Now you’ll open a modeling window to build a use case diagram.<br />

You’ll use the modeling tools in the Use Case Diagram Tools tool<br />

folder.<br />

What you do To open a modeling window for your use case diagram:<br />

1 On the File menu, select Close to close the Welcome Window (if<br />

it’s open).<br />

2 Make sure your <strong>Learning</strong> <strong>FrameWork</strong> folder is highlighted in<br />

the folder view.


3 On the File menu, select New.<br />

Organizing your work<br />

<strong>FrameWork</strong> displays the New dialog box. The list on the left<br />

shows the types of diagrams you can build.<br />

Tip<br />

You can get detailed information about any <strong>FrameWork</strong><br />

dialog box by pressing the Help button in it.<br />

4 In the New dialog box:<br />

a In the list of diagram types, select UML Use Case.<br />

b In the Name field, type a name for the use case diagram.<br />

Call it Employee Hiring System.<br />

c Press the OK button.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

27


Organizing your work<br />

Lesson 2: Creating Your First Use Case Diagram<br />

28<br />

<strong>FrameWork</strong> opens the modeling window and places it in your<br />

<strong>Learning</strong> <strong>FrameWork</strong> folder.<br />

Note<br />

If your <strong>Learning</strong> <strong>FrameWork</strong> folder was highlighted as<br />

described in step 1, the new diagram is properly placed within<br />

it. If the diagram isn’t there, find it in the folder view and drag<br />

it to the <strong>Learning</strong> <strong>FrameWork</strong> folder.


Organizing your work<br />

5 In the standard toolbar, click on the Show Tool Folders button.<br />

<strong>FrameWork</strong> opens the Use Case Diagram Tools tool folder.<br />

Your desktop should now look something like this:<br />

Lesson 2: Creating Your First Use Case Diagram<br />

29


Organizing your work<br />

Lesson 2: Creating Your First Use Case Diagram<br />

30<br />

6 To create more space in which to work:<br />

● Close the Output and Document windows (if they’re open),<br />

as described in Lesson 1, “Navigating <strong>FrameWork</strong>.” Also<br />

close any open toolbars except the standard and common<br />

toolbars. To close a toolbar:<br />

1 Click right on any open toolbar.<br />

2 In the popup menu, click on the toolbar to deselect it.<br />

● Drag the split bar between the Project Organizer and the<br />

Project Workspace to give yourself even more space in which<br />

to work. Do the same with the split bar between the Project<br />

Workspace and the Tool Folder window.<br />

A note about tool folders Each <strong>FrameWork</strong> diagram type is associated with one or more tool<br />

folders. When the Show Tool Folders button is pressed in,<br />

<strong>FrameWork</strong> automatically opens the tool folders associated with<br />

the diagram in the active window. You can also choose specific tool<br />

folders to open by selecting them in the folder view, by using the<br />

Open option on the File menu, or by using the Open Tool Folder<br />

button in the standard toolbar.


Creating use cases<br />

Creating use cases<br />

Note The common toolbar also contains modeling tools. You’ll<br />

learn about these tools in Lesson 5, “Creating a Java Class<br />

Diagram,” and Lesson 6, “Adding More Detail to Your Java<br />

Classes.”<br />

Your first use case Now that you’ve opened a use case modeling window and the Use<br />

Case Diagram Tools tool folder and cleared the deck, you’re ready<br />

to start your diagram.<br />

Use cases represent types of interactions that can occur between a<br />

system and its users. You’ll begin the Employee Hiring System use<br />

case diagram by placing a use case in the modeling window. You’ll<br />

call this use case Seek Resumes.<br />

What you do To create the Seek Resumes use case:<br />

1 In the Use Case Diagram Tools tool folder, click and hold on the<br />

Use Case tool.<br />

Tip<br />

When your cursor moves over a tool, the status bar gives a<br />

brief description of how to use it.<br />

2 Move your cursor to roughly the center of the Employee Hiring<br />

System modeling window and release the mouse button.<br />

<strong>FrameWork</strong> creates a new use case in the KnowledgeBase and<br />

places a graphic for it where you released the mouse button.<br />

<strong>FrameWork</strong> also opens an edit box for the use case name.<br />

3 Type Seek Resumes. Then click on the window background to<br />

close the edit box.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

31


If you make a mistake<br />

Lesson 2: Creating Your First Use Case Diagram<br />

32<br />

Your Employee Hiring System diagram should look something<br />

like this:<br />

4 Using the procedure in steps 2 through 4, place a use case<br />

named Screen Resumes below the Seek Resumes use case. Don’t<br />

worry if your graphics aren’t exactly lined up. You’ll learn how<br />

to align graphics in Lesson 4, “Improving the Appearance of<br />

Your Diagrams.”<br />

If you make a mistake<br />

Deleting objects If you inadvertently create an object that you don’t want, you can<br />

delete it.<br />

What you do To delete an object:<br />

1 Place your cursor on the object and click right to open its popup<br />

menu.


If you make a mistake<br />

2 On the popup menu, select Terminate and then KnowledgeBase<br />

and Graphics.<br />

3 In the message box that <strong>FrameWork</strong> displays, press the Yes<br />

button.<br />

What happens When you select Terminate KnowledgeBase and Graphics for an<br />

object, two things happen:<br />

■ <strong>FrameWork</strong> deletes any graphics that represent the object in<br />

any modeling window.<br />

■ <strong>FrameWork</strong> deletes the object itself from the KnowledgeBase.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

33


Creating composite use cases<br />

Lesson 2: Creating Your First Use Case Diagram<br />

34<br />

If you want to delete only the graphic representation of an object,<br />

but not the KnowledgeBase object itself, you can use the Graphics<br />

option on the Terminate submenu. Alternatively, you can use the<br />

Delete key on your keyboard or the Delete Graphics option on the<br />

Edit menu.<br />

Tip<br />

If you accidentally delete an object you want to keep, select<br />

Undo on the Edit menu to recreate it. Alternatively, if you’ve<br />

deleted only the graphic, you can recreate it by holding down the<br />

Control key while you use the tool with which you originally<br />

created the object.<br />

Creating composite use cases<br />

Use cases that contain<br />

other systems<br />

Composite use cases are use cases that incorporate one or more<br />

additional systems. In your Employee Hiring System use case<br />

diagram, you’ll include a composite use case representing a<br />

subsystem within the Employee Hiring system. In Lesson 3,<br />

“Getting More Specific about Your Hiring System,” you’ll create a<br />

second use case diagram to show the details of this composite use<br />

case.<br />

What you do To create a composite use case:<br />

1 In the Use Case Diagram Tools tool folder, click and hold on the<br />

Composite Use Case tool.<br />

2 Move your cursor below the Screen Resumes use case and release<br />

the mouse button to create the new composite use case graphic.<br />

3 Call your composite use case Hire Employees. Type this name<br />

and then click on the window background to close the edit box.


Creating actors<br />

Creating actors<br />

You now have a composite use case to go with the two use cases.<br />

Users of a system Actors represent roles in which people, jobs, organizations, or<br />

other systems interact with one or more use cases. They represent<br />

the users of a system.<br />

What you do To create the actors:<br />

You’ll continue the creation of the Employee Hiring System<br />

diagram by adding four actors to the diagram.<br />

1 In the Use Case Diagram Tools tool folder, click and hold on the<br />

Actor tool.<br />

2 Move your cursor to the top left portion of the modeling window<br />

and release the mouse button to create the new actor graphic.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

35


Creating actors<br />

Lesson 2: Creating Your First Use Case Diagram<br />

36<br />

3 Call your actor HR Representative. Type this name and then<br />

click on the window background to close the edit box.<br />

You now have an actor to go with the use cases.<br />

You’ll create three more actors to expand your Employee Hiring<br />

System diagram.<br />

4 Using the procedure in steps 1 through 3, place an actor named<br />

Department Head in the bottom left portion of the window, an<br />

actor named Employee Recruitment Agency in the top right<br />

portion, and an actor named Candidate in the bottom right<br />

portion.


Creating communication relationships<br />

When finished, you should have a diagram that looks something<br />

like this:<br />

Creating communication relationships<br />

Communications establish relationships between actors and use<br />

cases. A communication can be:<br />

■ A bidirectional communication, in which messages flow both<br />

ways between the actor and the use case<br />

■ A communication from the actor to the use case<br />

■ A communication from the use case to the actor<br />

Now that you’ve created use cases and actors, you’ll want to show<br />

the communication relationships that exist between them. You’ll<br />

begin with bidirectional communications.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

37


Creating bidirectional communications<br />

Creating bidirectional communications<br />

What you do To create bidirectional communications:<br />

Lesson 2: Creating Your First Use Case Diagram<br />

38<br />

1 In the Use Case Diagram Tools tool folder, click and hold on the<br />

Bidirectional Communication tool.<br />

2 Move your cursor to the HR Representative actor and release the<br />

mouse button. Then click on the Seek Resumes use case.<br />

3 Using the procedure in steps 1 and 2, create a bidirectional<br />

communication between the HR Representative actor and the<br />

Hire Employees use case. Then create two more bidirectional<br />

communications between the Hire Employees use case and the<br />

Department Head and Candidate actors.<br />

Your diagram should now look something like this:


Creating one-way communications<br />

Creating one-way communications<br />

The next step is to create communications that go in one direction.<br />

To do this:<br />

1 In the Use Case Diagram Tools tool folder, click and hold on the<br />

Communication from Actor tool.<br />

2 Move your cursor to the Employment Recruitment Agency actor<br />

and release the mouse button. Then click on the Seek Resumes<br />

use case.<br />

Your diagram should look like this:<br />

Lesson 2: Creating Your First Use Case Diagram<br />

39


Creating one-way communications<br />

Lesson 2: Creating Your First Use Case Diagram<br />

40<br />

3 In the Use Case Diagram Tools tool folder, click and hold on the<br />

Communication from Use Case tool.<br />

4 Move your cursor to the Screen Resumes use case and release the<br />

mouse button. Then click on the HR Representative actor.<br />

5 Repeat steps 3 and 4 to create a one-way communication from<br />

the Screen Resumes use case to the Department Head actor.<br />

Your Employee Hiring System use case diagram should now look<br />

something like this:


Creating subsystems<br />

Creating subsystems<br />

Grouping use cases A subsystem represents an integrated group of processes and/or<br />

resources that, as a whole, serves some purpose within the<br />

enterprise. The use cases you’ve created belong to the Employee<br />

Hiring subsystem. You’ll show that now in your diagram.<br />

What you do To create a subsystem:<br />

1 If you don’t have enough room to add a graphic above the Seek<br />

Resumes graphic, do this:<br />

a On the Edit menu, select Select All.<br />

b Click and hold on any of the selected graphics. Then drag<br />

the graphics down to create more space at the top of the<br />

window.<br />

c Click on the window background to deselect the graphics.<br />

2 In the Use Case Diagram Tools tool folder, click and hold on the<br />

Subsystem tool.<br />

3 Move your cursor above the Seek Resumes use case and release<br />

the mouse button to create the new subsystem graphic.<br />

4 Name the subsystem Employee Hiring.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

41


Creating subsystems<br />

Lesson 2: Creating Your First Use Case Diagram<br />

42<br />

Your diagram should look something like this:<br />

Once you’ve created the Employee Hiring subsystem, the next<br />

step is to connect it to the use cases it contains.<br />

5 In the Use Case Diagram Tools tool folder, click and hold on the<br />

Subsystem Use Cases tool.


Creating subsystems<br />

6 Move your cursor to a position above and to the left of the Seek<br />

Resumes use case and release the mouse button. Your cursor<br />

will change to indicate that you can draw a bounding box.<br />

7 While holding down the mouse button, drag a bounding box<br />

around the Seek Resumes, Screen Resumes, and Hire Employees<br />

use cases. Then release the mouse button.<br />

Your cursor will change to indicate that you can select an object.<br />

8 Click on the Employee Hiring subsystem.<br />

<strong>FrameWork</strong> draws the bounding box and connects it to the<br />

Employee Hiring subsystem.<br />

Tip<br />

If you cannot see the bounding box:<br />

a Move your cursor around slowly over the area where the<br />

bounding box should be until you see the box highlighted.<br />

b With the bounding box highlighted, click right to open its<br />

popup menu and select Graphic Properties.<br />

c In the Graphic Properties dialog box, change the value in<br />

the Pen Width field to 2. Then press the OK button.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

43


Saving your work<br />

Saving your work<br />

Lesson 2: Creating Your First Use Case Diagram<br />

44<br />

You have now completed your Employee Hiring System use case<br />

diagram. It should look something like this:<br />

Tip<br />

To close the Use Case Diagram Tools tool folder, click again on<br />

the Show Tool Folders button in the standard toolbar.<br />

The KnowledgeBase file Now that you’ve completed your first diagram, you should save<br />

your work. When you save, <strong>FrameWork</strong> writes your<br />

KnowledgeBase to a file with the extension .pkb. The filename is<br />

the name you gave the KnowledgeBase when you created it in<br />

“Opening a new KnowledgeBase for your work” earlier in this<br />

lesson.


What you do To save your work:<br />

On the File menu, select Save KnowledgeBase.<br />

Tip<br />

Using naming conventions<br />

It’s good modeling discipline to save your work frequently.<br />

Using naming conventions<br />

Use case names Observing a few naming conventions will help keep your models<br />

consistent. Use cases are generally named with a verb phrase and<br />

a plural noun. For example, Hire Employees is a verb phrase. Use<br />

initial capital letters on the words.<br />

Actor names Actors are named with a singular noun phrase. For example, HR<br />

Representative is a singular noun phrase. Use initial capital letters<br />

on the words.<br />

Lesson 2: Creating Your First Use Case Diagram<br />

45


3<br />

Getting More Specific<br />

about Your Hiring System<br />

What you’ll learn<br />

In this lesson, you’ll get a little more specific about your use case<br />

diagram. You’ll learn how to:<br />

■ Show more detail about your composite use case by building a<br />

lower-level use case diagram<br />

■ Create a subdiagram<br />

■ Create graphic references to windows<br />

■ Check spelling in modeling windows<br />

Breaking down a composite use case<br />

From the general to the<br />

more specific<br />

3<br />

When modeling a business system or application, you often start<br />

with the more general components and then specify more detail.<br />

The use case diagram you built in Lesson 2, “Creating Your First<br />

Use Case Diagram,” describes the big picture of a system and is<br />

fairly simple and straightforward. The composite use case<br />

contained in the diagram, however, indicates the presence of a<br />

second system that serves as a component of the first.<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

47


Breaking down a composite use case<br />

You can use additional diagrams to represent the components of a<br />

diagram in more detail. To illustrate this, you’ll break down the<br />

Hire Employees composite use case you created in Lesson 2 to<br />

provide more detail about it.<br />

What you do To break down the Hire Employees composite use case:<br />

1 Open the Employee Hiring System use case diagram if it’s not<br />

open already.<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

48<br />

Tip<br />

If the Employee Hiring System diagram is open but not<br />

visible, simply click on its tab at the bottom of the Project<br />

Workspace to make it active.<br />

2 Make sure your <strong>Learning</strong> <strong>FrameWork</strong> folder is highlighted in<br />

the folder view.<br />

3 Place your cursor on the Hire Employees composite use case and<br />

click right to open its popup menu.<br />

4 On the popup menu, select New Subdiagram and then More.<br />

<strong>FrameWork</strong> displays the New dialog box.


5 In the New dialog box:<br />

Breaking down a composite use case<br />

a In the list of diagram types, select UML Use Case.<br />

b In the name field, type a name for the use case diagram in<br />

the Diagram Name field. Call it Employee Acquisition<br />

Subsystem.<br />

c Press the OK button.<br />

<strong>FrameWork</strong> opens a window for the new diagram and adds the<br />

window to your <strong>Learning</strong> <strong>FrameWork</strong> folder.<br />

Subdiagrams A diagram that shows the details of an object in another diagram is<br />

called a subdiagram. In this exercise, you opened a new modeling<br />

window to create a subdiagram of the Hire Employees use case.<br />

You’ll build this diagram in just a minute. Before you do that,<br />

however, make the Employee Hiring System window active again.<br />

Notice that <strong>FrameWork</strong> has marked the Hire Employees use case<br />

with an enclosed plus sign ( ). This symbol indicates that the use<br />

case has a subdiagram.<br />

Navigating to a subdiagram You can navigate from an object to its subdiagram by doubleclicking<br />

on the object or by selecting the diagram from the<br />

Subdiagrams submenu of the popup menu for the object. Doubleclick<br />

on the Hire Employees use case now to return to the Employee<br />

Acquisition Subsystem window.<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

49


Building an employee acquisition diagram<br />

Building an employee acquisition diagram<br />

How to proceed Now that you’ve created the subdiagram window, consider how to<br />

proceed. You need to model just how a system that addresses the<br />

acquisition of employees might look. Some basic use cases in this<br />

diagram might be interviewing candidates, testing applicants,<br />

making job offers, and orienting new hires. Some of the actors<br />

might be the HR representative, the department head, the trainer,<br />

and the candidate.<br />

The principles you’ll use are the same as those you exercised when<br />

you created the higher-level Employee Hiring System diagram.<br />

That is, a subsystem contains use cases that represent the ways in<br />

which users, represented as actors, interact with the subsystem.<br />

What you do To build your second use case diagram:<br />

1 Open the Employee Acquisition Subsystem window if it’s not<br />

open already.<br />

2 If the Show Tool Folders button ( ) in the standard toolbar is<br />

not pressed in, click on it to open the Use Case Diagram Tools<br />

tool folder.<br />

3 Using the Use Case tool, create four use cases in the window<br />

and name them Interview Candidates, Test Candidates, Make Job<br />

Offer, and Orient New Hires.<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

50


Your diagram should look something like this:<br />

Building an employee acquisition diagram<br />

4 Using the Subsystem tool, create a subsystem named Employe<br />

Aquisition. Note that both words in this name are misspelled.<br />

You’ll learn how to find and correct these errors with the<br />

<strong>FrameWork</strong> spell checker later in this lesson.<br />

5 In the Use Case Diagram Tools tool folder, click and hold on the<br />

Subsystem Use Cases tool.<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

51


Building an employee acquisition diagram<br />

6 Move your cursor to a position above and to the left of the<br />

Interview Candidates use case and release the mouse button.<br />

Your cursor will change to indicate that you can draw a<br />

bounding box.<br />

7 While holding down the mouse button, drag a bounding box<br />

around the four use cases. Then release the mouse button.<br />

8 Click on the Employe Aquisition subsystem.<br />

Your diagram should now look something like this:<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

52


Adding actors and communications<br />

Adding actors and communications<br />

Copying and pasting actors Your Employee Acquisition Subsystem use case diagram will use<br />

three of the actors you created in your Employee Hiring System<br />

diagram: HR Representative, Department Head, and Candidate. You<br />

can copy these actors from one diagram to the other.<br />

What you do To copy actors from the Employee Hiring System diagram to the<br />

Employee Acquisition Subsystem diagram:<br />

1 Open the Employee Hiring System use case diagram if it’s not<br />

open already.<br />

2 Select the HR Representative actor.<br />

3 While holding down the Shift key, select the Department Head<br />

actor and then the Candidate actor.<br />

4 On the Edit menu, select Copy.<br />

5 Make the Employee Acquisition Subsystem window active.<br />

6 On the Edit menu, select Paste.<br />

<strong>FrameWork</strong> places copies of the three actor graphics in the<br />

Employee Acquisition Subsystem window.<br />

7 Click on the window background to deselect the actors.<br />

8 Click and hold on the Candidate actor. Then drag it up to the<br />

level of the HR Representative actor and release the mouse<br />

button.<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

53


Adding actors and communications<br />

Your Employee Acquisition Subsystem diagram should now look<br />

something like this:<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

54


Adding actors and communications<br />

Try it yourself Think about any other actors you need to represent in this<br />

Employee Acquisition Subsystem use case diagram. Also, think<br />

about how all the actors interact with the system consisting of the<br />

four use cases you’ve created already. Using what you’ve learned so<br />

far, try to model these actors and relationships yourself.<br />

The Employee Acquisition Subsystem diagram you develop could<br />

look something like this:<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

55


Checking spelling<br />

Checking spelling<br />

Correcting your spelling<br />

errors<br />

<strong>FrameWork</strong> makes it easy for you to find and correct spelling errors<br />

in your modeling windows. To see how this works, you’ll now<br />

correct the spelling errors you made in the Employee Acquisition<br />

Subsystem diagram.<br />

What you do To find and correct these spelling errors:<br />

1 Open the Employee Acquisition Subsystem window if it’s not<br />

open already.<br />

2 On the Tools menu, select Spelling.<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

56<br />

<strong>FrameWork</strong> begins to check the spelling of all the text that<br />

appears in the Employee Acquisition Subsystem window. When<br />

<strong>FrameWork</strong> encounters the first error, it displays the Check<br />

Spelling dialog box. The Not in Dictionary field shows the<br />

misspelled word. The field at the bottom of the dialog box<br />

shows the full text in which the error occurs.


3 In the Check Spelling dialog box:<br />

Checking spelling<br />

a In the Suggestions field, select Employee. <strong>FrameWork</strong><br />

displays this word in the Change To field.<br />

b Press the Change button.<br />

<strong>FrameWork</strong> replaces Employe with Employee in the text at the<br />

bottom of the dialog box and shows you the next spelling error<br />

in the Not in Dictionary field.<br />

4 Press the Change button to replace Aquisition with Acquisition,<br />

which appears by default in the Change To field.<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

57


Checking spelling<br />

Lesson 3: Getting More Specific about Your Hiring System<br />

58<br />

Because this is the last error it can find, <strong>FrameWork</strong><br />

automatically closes the Check Spelling dialog box and applies<br />

your corrections to the text in the modeling window. Your<br />

finished Employee Acquisition Subsystem diagram should now<br />

look something like this:<br />

Tip<br />

If you haven’t already done so, now would be a good time to<br />

save your work.


4<br />

Improving the Appearance<br />

of Your Diagrams<br />

What you’ll learn<br />

Now that you’ve successfully built your first two diagrams, you’ll<br />

learn some techniques for improving their appearance. After<br />

completing this lesson, you’ll be able to use this information to<br />

enhance the appearance of your diagrams as you build them.<br />

In this lesson, you’ll find information on:<br />

■ Annotating diagrams<br />

■ Formatting text<br />

■ Aligning graphic objects<br />

■ Bending connection graphics<br />

■ Repositioning text<br />

■ Resizing graphic objects<br />

4<br />

You’ll practice the techniques in this lesson by making changes to<br />

the appearance of your Employee Hiring System diagram. This is<br />

the diagram you built in Lesson 2, “Creating Your First Use Case<br />

Diagram.”<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

59


Adding annotations to diagrams<br />

Adding annotations to diagrams<br />

Uses of annotations Annotations are freestanding text that you add to diagrams. You<br />

can use annotations to clarify concepts, provide instructions, add<br />

detail, or for any other purpose you choose. You’ll start this lesson<br />

by adding an annotation to your Employee Hiring System diagram.<br />

What you do To add an annotation to the Employee Hiring System diagram:<br />

1 Open the Employee Hiring System diagram if it’s not open<br />

already.<br />

2 In the common toolbar, select the Text tool.<br />

3 In the Employee Hiring System window, click on the window<br />

background near the HR Representative actor.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

60<br />

<strong>FrameWork</strong> places an anchor for the text in the window and<br />

opens an edit box.<br />

4 Type First to screen resumes. Then click on the window<br />

background to close the edit box.<br />

5 Drag the text to position it next to the actor.


Your diagram should now look something like this:<br />

Adding annotations to diagrams<br />

Deleting freestanding text If you decide you don’t want the annotation in your diagram, you<br />

can delete it. <strong>FrameWork</strong> treats freestanding text as a graphic<br />

only, without a corresponding object in the KnowledgeBase. This<br />

means that to remove it, you need to delete only the graphic. To do<br />

this:<br />

1 Select the text you want to delete.<br />

2 On the Edit menu, select Delete Graphics.<br />

Tip<br />

<strong>FrameWork</strong> deletes the text.<br />

You can also use the Delete key to delete graphics.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

61


Formatting text<br />

Formatting text<br />

Font changes <strong>FrameWork</strong> lets you format text by changing various aspects of the<br />

font it uses. You can format both freestanding text and text<br />

associated with graphic objects in your diagrams. In this exercise,<br />

you’ll format all the text in the Employee Hiring System diagram.<br />

What you do To format text in the Employee Hiring System diagram:<br />

1 Open the Employee Hiring System diagram if it’s not open<br />

already.<br />

2 On the Edit menu, select Select All.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

62<br />

<strong>FrameWork</strong> places selection handles on each graphic in the<br />

diagram.<br />

3 On the Format menu, select Text.<br />

<strong>FrameWork</strong> displays the Font dialog box.


Formatting text<br />

4 In the Font dialog box, change one or more of the font, style,<br />

size, effects, and color options. The Sample field lets you<br />

preview the changes you make.<br />

5 Press the OK button to close the Font dialog box and apply the<br />

changes to the text in your diagram.<br />

If, for example, you selected Bold Italic as the font style, your<br />

diagram would now look something like this:<br />

Setting text defaults You can change the default settings for the text in all the diagrams<br />

you’ll create. Changing default settings has no effect on the<br />

diagrams you’ve already built. It affects only those you build later.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

63


Aligning graphic objects<br />

To change the default settings for text:<br />

1 Click on the background of the Employee Hiring System<br />

window to ensure that nothing is selected.<br />

2 On the Format menu, select Text.<br />

3 In the Font dialog box, make the changes you want. Then press<br />

the OK button.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

64<br />

<strong>FrameWork</strong> changes the default settings. The new settings will<br />

remain in effect until you change them again.<br />

Aligning graphic objects<br />

Ways to align objects Your diagrams will be easier to read and understand if the graphic<br />

objects in them are aligned with each other. You can align objects<br />

by positioning them either with respect to each other or with<br />

respect to a grid. You’ll practice both ways, but first you’ll learn<br />

how to select multiple objects.<br />

Selecting multiple objects To select multiple objects:<br />

1 In the common toolbar, select the Select tool if it’s not selected<br />

already.


Aligning objects with<br />

respect to each other<br />

2 Do either of the following:<br />

Aligning graphic objects<br />

● Click and hold on the window background near one of the<br />

objects you want to select. Then drag a bounding box<br />

around all the objects you want and release the mouse<br />

button.<br />

Note<br />

Depending on your operating environment, you may<br />

not see the bounding box while you’re dragging.<br />

<strong>FrameWork</strong> highlights the objects within the boundaries of<br />

the box, however, so you’ll be able to tell which objects you’re<br />

selecting.<br />

● Select one of the objects you want. Then hold down the Shift<br />

key and select each of the other objects.<br />

In the Employee Hiring System diagram, you’ll align the HR<br />

Representative actor with the Department Head actor. To do this:<br />

1 In the Employee Hiring System diagram, select the HR<br />

Representative actor and the Department Head actor.<br />

2 On the Format menu, select Icon Alignment and then Center.<br />

<strong>FrameWork</strong> aligns the center of the first graphic you selected<br />

with center of the second.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

65


Aligning graphic objects<br />

Aligning objects with<br />

respect to a grid<br />

You can display a grid to help you arrange the graphic objects in a<br />

window. You can use the grid as a visual aid for positioning objects<br />

yourself, or you can have objects automatically align with the grid.<br />

To use the grid to align the Seek Resumes, Screen Resumes, and Hire<br />

Employees use cases:<br />

1 With the Employee Hiring System window active, select Show<br />

Grid on the View menu.<br />

<strong>FrameWork</strong> displays the grid.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

66


Aligning objects to the grid<br />

by default<br />

Bending connection graphics<br />

2 Select the Seek Resumes, Screen Resumes, and Hire Employees use<br />

cases.<br />

3 On the Format menu, select Align to Grid.<br />

<strong>FrameWork</strong> aligns the top and left sides of each selected object<br />

with the nearest grid lines.<br />

You can have each graphic object you create or move in a window<br />

align to the grid automatically. By default, this feature is enabled<br />

for each new diagram you create. To disable this feature for the<br />

active window (or to turn it back on):<br />

On the View menu, select Snap to Grid.<br />

Bending connection graphics<br />

Connections across other<br />

graphics<br />

As your diagrams become more complex, the graphics that<br />

represent connections between objects can sometimes cross over<br />

other objects and connections. This can make a diagram difficult to<br />

read. You can solve the problem partially by positioning connected<br />

objects near each other when possible. You can also address the<br />

problem by bending the connection graphics.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

67


Bending connection graphics<br />

What you do In this exercise, you’ll bend the connection graphics that represent<br />

the communications between the Screen Resumes use case and the<br />

HR Representative and Department Head actors. To do this:<br />

1 In the Employee Hiring System window, select the connection<br />

graphic for the communication between the HR Representative<br />

actor and the Screen Resumes use case.<br />

2 Click on the line portion of the selected connection.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

68<br />

<strong>FrameWork</strong> creates a joint in the line and marks it with a<br />

selection handle. A joint is a point at which you can bend a line.


Bending connection graphics<br />

3 Click and hold on the joint. Then drag to bend the connection<br />

graphic the way you want it and release the mouse button.<br />

4 Repeat steps 1 through 3 to put a second bend in the<br />

communication between the HR Representative actor and the<br />

Screen Resumes use case.<br />

5 Using the same procedure, bend the communication between<br />

the Department Head actor and the Screen Resumes use case in<br />

two places.<br />

When you’re finished, your diagram might look something like this:<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

69


Repositioning text<br />

Repositioning text<br />

Text positions Another way to enhance the appearance of a diagram is to change<br />

the placement of the text for certain graphics. One option is to<br />

reposition the text so that it’s outside the graphic, as it is for the<br />

actor graphics in your Employee Hiring System diagram. You can<br />

place text above, below, or to either side of its associated graphic.<br />

Another option is to position text inside the graphic, as it is for the<br />

use case and subsystem graphics.<br />

Note<br />

By default, <strong>FrameWork</strong> wraps the text associated with a<br />

graphic to fit the width of the graphic, regardless of where the text<br />

is positioned.<br />

What you do To see how this works, you’ll reposition the text for the Employee<br />

Hiring subsystem. To do this:<br />

1 In your Employee Hiring System diagram, select the Employee<br />

Hiring subsystem.<br />

2 On the Format menu, select Text Position and then Top.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

70<br />

<strong>FrameWork</strong> moves the text above your Employee Hiring<br />

subsystem graphic.


Resizing a graphic<br />

Your diagram should now look something like this:<br />

Resizing a graphic<br />

Graphic too big? The new placement of the text for the Employee Hiring subsystem<br />

leaves the graphic appearing too large. You can improve the<br />

appearance of your diagram by resizing the graphic.<br />

What you do To make your Employee Hiring graphic smaller:<br />

1 Select the Employee Hiring graphic.<br />

2 Place your cursor on any one of the eight selection handles<br />

located at the corners and sides of the graphic. You’ll see the<br />

cursor change to a double-ended arrow.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

71


Resizing a graphic<br />

3 While holding down the mouse button, drag the handle until the<br />

graphic is the size you want. Then release the mouse button.<br />

4 Click on the window background to deselect the graphic.<br />

Tip You can also use this technique to change the dimensions of<br />

freestanding text.<br />

Your diagram should now look something like this:<br />

Don’t forget to save your work.<br />

Tip<br />

You can use the Graphic Properties option on the popup menu<br />

of a graphic object to change its color. You can also assign different<br />

graphics to your objects. For more information on this, see Using<br />

<strong>FrameWork</strong>.<br />

Lesson 4: Improving the Appearance of Your Diagrams<br />

72


5<br />

Creating a Java Class<br />

Diagram<br />

What you’ll learn<br />

In this lesson, you’ll build a Java class diagram. Along the way,<br />

you’ll learn about:<br />

■ The structure of Java class diagrams<br />

■ Associations and the inverse relationships between classes<br />

■ Association ends and their role names and multiplicity<br />

■ Inheritance relationships between classes, including incomplete<br />

partitions and generalizations<br />

■ Ordering associations, which create relationships between<br />

objects in the same class<br />

5<br />

Lesson 5: Creating a Java Class Diagram<br />

73


Creating the diagram<br />

Creating the diagram<br />

Java class diagrams A Java class diagram presents a static view of the objects on which<br />

a system acts and the operations that affect them. It contains<br />

objects that correspond to a range of Java constructs, including<br />

Java classes, interfaces, and exceptions.<br />

Lesson 5: Creating a Java Class Diagram<br />

74<br />

The Java class diagram is a variation of the UML class diagram<br />

that has been specialized to facilitate Java code generation.<br />

<strong>FrameWork</strong> also provides diagram types for modeling other<br />

language-specific classes, such as C++ and CORBA IDL.<br />

In this lesson, you’ll build a simple Java class diagram that defines<br />

the information requirements of your hiring system. In the next<br />

lesson, “Adding More Detail to Your Java Classes,” you’ll enhance<br />

your diagram by adding attributes and operations to your Java<br />

classes. Then later in Lesson 9, “Generating Code,” you’ll use the<br />

classes you’ve defined to automatically generate Java code.<br />

Tip<br />

Don’t worry if you’re not familiar with Java. You can still do<br />

this lesson, and the techniques you learn will apply to your own<br />

development environment as well.<br />

What you do To create a Java class diagram:<br />

1 With your <strong>Learning</strong> <strong>FrameWork</strong> folder highlighted, select New<br />

on the File menu.<br />

2 In the New dialog box, select Java Class and name your new<br />

diagram Employee Hiring Classes. Then press the OK button.<br />

3 If the Show Tool Folders button ( ) in the standard toolbar is<br />

not pressed in, click on it to open the Java Class Diagram Tools<br />

tool folder.


Creating classes<br />

Creating classes<br />

Classes A class is a category of objects that share some common behavior<br />

or properties. A Java class is a class whose properties include<br />

some that are specific to the Java programming language. You’ll<br />

begin your Java class diagram by creating two Java classes.<br />

What you do To create Java classes in your Java class diagram:<br />

1 In the Java Class Diagram Tools tool folder, select the Java<br />

Class tool.<br />

2 Move your cursor to the center of the window and release the<br />

mouse button.<br />

3 Name the class Person. Then click on the window background<br />

to close the edit box.<br />

4 Create another Java class. Name it City.<br />

At this point, your diagram should look something like this:<br />

Lesson 5: Creating a Java Class Diagram<br />

75


Creating an association<br />

Creating an association<br />

Associations An association represents a relationship between the objects in<br />

two classes. It consists of two association ends. These<br />

association ends define mappings in either direction between the<br />

two classes. They are inverses of each other.<br />

Source and target classes Each association end has a source and a target. The source is the<br />

class from which the association end is mapped. The target is the<br />

class to which it is mapped.<br />

Relating your first two classes<br />

People and cities In your hiring system, a relationship exists between people and the<br />

cities in which they live. You’ll show this relationship by creating<br />

an association between the Person and City classes.<br />

Using modeling tools in<br />

toolbars<br />

Lesson 5: Creating a Java Class Diagram<br />

76<br />

You use the Association tool in the common toolbar to create<br />

associations. To use a modeling tool in a toolbar, you first select the<br />

tool by clicking on it and releasing the mouse button. Then you<br />

move your cursor into the modeling window and perform the tool<br />

actions. This is different from using tools in tool folders, which you<br />

start using by dragging from the tool into the modeling window.<br />

You can double-click on a modeling tool in a toolbar to keep it active<br />

for multiple uses. When you’re done with it, click on the Select tool<br />

( ) to deactivate it.<br />

What you do To create an association between the Person and City classes in your<br />

Java class diagram:<br />

1 In the common toolbar, select the Association tool.


2 Click and hold on the Person class.<br />

Renaming the association ends<br />

3 Drag from the Person class to the City class and release the<br />

mouse button.<br />

<strong>FrameWork</strong> draws the connection graphic for the association<br />

between the Person and City classes and labels each of the<br />

association ends that define the association.<br />

Tip When you use the Association tool to create an association<br />

between two classes, it doesn’t matter which class you start<br />

from.<br />

Your diagram should look something like this:<br />

Tip<br />

If your classes are too close together, the labels for the<br />

association ends may appear to be reversed. To remedy this, you<br />

can either move the classes farther apart or move each label closer<br />

to the target class of its association end.<br />

Renaming the association ends<br />

Role names When you create an association, the name of each association end<br />

(called the role name) appears at the target class end of its<br />

connection graphic. By default, the role name is the same as the<br />

name of the target class except that it’s all lowercase.<br />

Lesson 5: Creating a Java Class Diagram<br />

77


Renaming the association ends<br />

Lesson 5: Creating a Java Class Diagram<br />

78<br />

As you can see, the role names of the association ends you created<br />

do little to describe the relationship that exists between people and<br />

cities. You’ll want to rename the associations ends to emphasize<br />

the fact that cities are where people live.<br />

What you do To rename the association ends:<br />

1 Click once on the role name city. Then click again to open its<br />

edit box.<br />

Tip Even though you’re clicking twice in succession, this is not<br />

a double-click. Be sure to pause between clicks. Otherwise,<br />

<strong>FrameWork</strong> will interpret them as a double-click and display a<br />

message telling you there is no diagram anchored to the object<br />

(that is, the object has no subdiagrams).<br />

2 Rename the association end home city. Then click on the<br />

window background to close the edit box.<br />

3 Using the procedure in steps 1 and 2, change the role name of<br />

the person association end to residents.<br />

Your diagram should now look like this:<br />

Tip<br />

To fit the name of the home city association end on a single<br />

line, select it and use the selection handles to resize its anchor.


Setting the multiplicity of an association end<br />

Setting the multiplicity of an association end<br />

Multiplicity Along with the role name of an association end, <strong>FrameWork</strong><br />

displays its multiplicity. The multiplicity of an association end<br />

specifies, for a given object in the source class, the minimum and<br />

maximum number of objects in the target class that the object can<br />

be connected to.<br />

When you create an association, the multiplicity of each association<br />

end is unbounded by default. That means that each object in the<br />

source class can be connected to any number of objects in the target<br />

class, including 0 (zero).<br />

Notation for multiplicity <strong>FrameWork</strong> shows the multiplicity of an association end after the<br />

role name. If the minimum and maximum are different,<br />

<strong>FrameWork</strong> shows both values, separated by two periods (for<br />

example, 1..7). If the minimum and maximum are the same,<br />

<strong>FrameWork</strong> shows the value only once (for example, 1).<br />

<strong>FrameWork</strong> uses an asterisk (*) to represent unbounded<br />

multiplicity.<br />

What you do In your Java class diagram, you’ll change the multiplicity of the<br />

home city association end to indicate that people can reside in at<br />

most one city. To do this:<br />

1 Place your cursor on the home city association end and click<br />

right to open its popup menu.<br />

Lesson 5: Creating a Java Class Diagram<br />

79


Creating inheritance relationships<br />

Lesson 5: Creating a Java Class Diagram<br />

80<br />

2 On the popup menu, select Multiplicity and then 0..1.<br />

Your diagram should now look like this:<br />

Creating inheritance relationships<br />

You can define inheritance relationships for classes in a Java<br />

class diagram. You create these relationships between<br />

superclasses and subclasses. A subclass inherits all the<br />

structural and behavioral features of its superclass.


Creating an incomplete partition<br />

<strong>FrameWork</strong> supports several types of inheritance relationships.<br />

You’ll learn about incomplete partitions and generalizations in this<br />

tutorial. For more information on inheritance relationships, see<br />

Modeling with <strong>Technology</strong> <strong>FrameWork</strong>.<br />

Creating an incomplete partition<br />

Incomplete partitions One kind of inheritance relationship is called an incomplete<br />

partition. An incomplete partition identifies two or more<br />

mutually exclusive subclasses of a superclass. Each object in the<br />

superclass may or may not also be in one of the subclasses.<br />

In your Java class diagram, you’ll create the Applicant and Employee<br />

Java classes. Then you’ll create an incomplete partition of the<br />

Person class containing the Applicant and Employee classes. This<br />

will show that both applicants and employees have the properties<br />

of people and that a person cannot be both an applicant and an<br />

employee at the same time. It also shows that there can be people<br />

who are neither applicants nor employees.<br />

What you do To create the two Java new classes and the incomplete partition:<br />

1 Using the Java Class tool, create a class and place it below and<br />

to the left of Person. Name the class Applicant.<br />

2 Create another Java class, placing it to the right of Applicant.<br />

Name the class Employee.<br />

3 In the common toolbar, select the Incomplete Partition tool.<br />

4 Click and hold on the window background outside of the<br />

Applicant class. Then drag a bounding box around Applicant and<br />

Employee and release the mouse button.<br />

Lesson 5: Creating a Java Class Diagram<br />

81


Creating a generalization<br />

Lesson 5: Creating a Java Class Diagram<br />

82<br />

5 Click on the Person class.<br />

<strong>FrameWork</strong> draws the incomplete partition and connects it to<br />

the Person class.<br />

Your Employee Hiring Classes diagram should look something like<br />

this:<br />

Creating a generalization<br />

Single class inheritance In “Creating an incomplete partition” above, you used an<br />

incomplete partition to model an inheritance relationship between<br />

the Person class and two mutually exclusive subclasses, Applicant<br />

and Employee. Now you’ll model the inheritance relationship<br />

between your Applicant class and a single subclass. You’ll use the<br />

subclass to represent applicants that are qualified.<br />

To model a single subclass, you’ll use a generalization. A<br />

generalization is an inheritance relationship defined between a<br />

single superclass and a single subclass.


What you do To create a generalization:<br />

Creating a generalization<br />

1 Using the Java Class tool, create a class and name it Qualified<br />

Candidate. Place the class below the Applicant class.<br />

2 In the common toolbar, select the Generalization tool.<br />

3 Drag from Qualified Candidate to Applicant and release the<br />

mouse button.<br />

<strong>FrameWork</strong> draws the generalization between the subclass<br />

Qualified Candidate and the superclass Applicant.<br />

Your diagram should look something like this:<br />

Lesson 5: Creating a Java Class Diagram<br />

83


Adding more related classes<br />

Adding more related classes<br />

Expanding your diagram At this point, your Java class diagram requires some additional<br />

classes in order to present a more complete picture of the objects<br />

that make up your hiring system. You’ll create a new class named<br />

State and relate it to the City class. Then you’ll create two new<br />

classes named Position and Skill and relate them to the Employee<br />

class. These new classes will play a supporting role in your<br />

diagram by making the definitions of the City and Employee classes<br />

more complete.<br />

Try it yourself The table below describes the associations you’ll create. Using the<br />

techniques you practiced earlier in this lesson, add the three new<br />

classes and the associations described below to your Java class<br />

diagram.<br />

Lesson 5: Creating a Java Class Diagram<br />

84<br />

Related classes Association ends Multiplicity<br />

State<br />

City<br />

Position<br />

Employee<br />

Skill<br />

Employee<br />

cities<br />

state<br />

assigned employees<br />

position<br />

employees<br />

skill set<br />

0..n<br />

0..1<br />

0..n<br />

1..1<br />

0..n<br />

0..n


Adding more related classes<br />

With these added classes in place, your diagram should look<br />

something like this:<br />

Lesson 5: Creating a Java Class Diagram<br />

85


Creating an ordering association<br />

Creating an ordering association<br />

Ordering associations An ordering association defines a relationship between objects in<br />

the same class. It consists of two different association ends that<br />

together impose an order on objects in the class.<br />

Lesson 5: Creating a Java Class Diagram<br />

86<br />

In your Java class diagram, you’ll create an ordering association on<br />

the Employee class. You’ll name one association end manager and<br />

the other direct reports. Then you’ll change the multiplicity to show<br />

that a manager can have any number of direct reports, but a direct<br />

report can have no more than one manager.<br />

What you do To create an ordering association on the Employee class:<br />

1 Open the popup menu for the Employee class and select<br />

Duplicate.


Creating an ordering association<br />

<strong>FrameWork</strong> creates a copy of the graphic for the class and<br />

places it overlapping the original graphic.<br />

2 Drag the copy of the Employee class and place it so that there is<br />

some space between it and the original.<br />

Tip<br />

Move the Position class to create space for the ordering<br />

association you’re about to create.<br />

3 Using the Association tool, create an association between the<br />

Employee class and its copy.<br />

<strong>FrameWork</strong> names the association ends employee and<br />

employee1.<br />

4 On the popup menu for the copy of the Employee class, select<br />

Terminate and then Graphics.<br />

<strong>FrameWork</strong> deletes the copy and the graphic connection<br />

representing the association you just created. The Employee<br />

class and the association, however, are still defined in the<br />

KnowledgeBase.<br />

Now you’ll use the Control key with the Association tool to<br />

recreate the connection graphic.<br />

5 Select the Association tool.<br />

Lesson 5: Creating a Java Class Diagram<br />

87


Creating an ordering association<br />

Lesson 5: Creating a Java Class Diagram<br />

88<br />

6 Position your cursor on the Employee class.<br />

7 While holding down the Control key, drag off and then back<br />

onto the class.<br />

8 Release the mouse button and Control key.<br />

<strong>FrameWork</strong> displays the Select Association End dialog box.<br />

Tip<br />

If you forget to hold down the Control key, <strong>FrameWork</strong><br />

creates a new ordering association. Just terminate the new<br />

association as described under “If you make a mistake” in<br />

Lesson 2, “Creating Your First Use Case Diagram,” and try<br />

again.<br />

9 In the Select Association End dialog box, double-click on either<br />

of the association ends for the ordering association (that is,<br />

employee or employee1).<br />

<strong>FrameWork</strong> redraws the connection graphic for the ordering<br />

association.<br />

10 Rearrange the graphics in your Employee Hiring Classes<br />

diagram so that you can see the ordering association clearly.<br />

For example, move the Position class up in the window and then<br />

drag the lefthand joints of the ordering association to the right<br />

side of the Employee class.<br />

11 Rename one of the association ends manager and the other direct<br />

reports.


Creating an ordering association<br />

12 Change the multiplicity of the manager association end from<br />

unbound to 0..1.<br />

When you’re done, your Java class diagram should look something<br />

like this:<br />

Lesson 5: Creating a Java Class Diagram<br />

89


6<br />

Adding More Detail to<br />

Your Java Classes<br />

What you’ll learn<br />

In this lesson, you’ll add more detail to the classes in your Java<br />

class diagram. You’ll learn how to:<br />

■ Create attributes, which are named, structural components of a<br />

class<br />

■ Create operations that can change the state of objects in a class<br />

■ Use forms to provide more information about attributes<br />

■ View classes using compartment notation<br />

6<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

91


Creating attributes<br />

Creating attributes<br />

Attributes Attributes are named, structural components of a class. Each<br />

attribute represents a property that provides more detail about the<br />

objects in the class. An attribute has a <strong>FrameWork</strong> type of integer<br />

or string, depending on which tool you use to create it.<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

92<br />

You’ll now want to provide some details for the Person class in your<br />

Java class diagram. The Applicant and Employee subclasses will<br />

inherit these attributes. You’ll want to capture details like home<br />

phone number, social security number, address, and others.<br />

What you do To create attributes for the Person class:<br />

1 Open the Employee Hiring Classes diagram if it’s not open<br />

already.<br />

2 In the common toolbar, select the String Attribute tool.<br />

3 Click and hold on the Person class. Then drag from Person and<br />

release the mouse button to place the graphic.<br />

4 Name the attribute home area code. Then click on the window<br />

background to close the edit box.


Your diagram should look something like this:<br />

Creating attributes<br />

Try it yourself You can continue adding attributes for the Person class. Use the<br />

String Attribute tool for text strings and the Integer Attribute tool<br />

( ) for numbers.<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

93


Creating attributes<br />

Adding an attribute to a<br />

subclass<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

94<br />

When you finish, your Employee Hiring Classes diagram could look<br />

something like this:<br />

The Applicant and Employee subclasses inherit all the attributes you<br />

just added for the Person class. Subclasses can have attributes of<br />

their own as well. Attributes defined on a subclass do not apply to<br />

the superclass. That’s because inheritance goes in only one<br />

direction.


To show that subclasses can have their own attributes:<br />

Creating attributes<br />

Add two attributes to the Employee class — one named employee<br />

id, the other salary.<br />

Your diagram should now look something like this:<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

95


Creating operations<br />

Creating operations<br />

Operations An operation is an action that changes something about an object.<br />

When you define an operation, you specify the class of objects it can<br />

affect. This class is called the owner class for the operation.<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

96<br />

In your Java class diagram, you’ll create two operations, one that<br />

applies to objects in the Applicant class and another that applies to<br />

objects in the Employee class.<br />

What you do To create the operations:<br />

1 In the Java Class Diagram Tools tool folder, click and hold on<br />

the Operation tool.<br />

2 Move your cursor onto the Applicant class and release the mouse<br />

button. Then click where you want to place the operation<br />

graphic.<br />

3 Name the operation Screen Applicant.<br />

4 Using the procedure in steps 1 through 3, create an operation<br />

for the Employee class named Orient New Hire.


Creating operations<br />

When you’re done, your Employee Hiring Classes diagram should<br />

look something like this:<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

97


Using forms to provide more information<br />

Using forms to provide more information<br />

Information on forms A form is a formatted display of information in a window. Each<br />

form in <strong>FrameWork</strong> is designed to show information about a<br />

particular type of object (for example, use cases or classes). The<br />

rectangular areas in which <strong>FrameWork</strong> displays information on a<br />

form are called fields.<br />

Using the Java Attribute<br />

Information form<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

98<br />

Forms give you a view of objects that’s different from the views in<br />

your modeling windows. When you’re interested in one particular<br />

object, viewing it on a form is an easy way to find out what you<br />

want to know. You can use forms to both view and modify<br />

information. You’ll use one now to change the data type of the<br />

salary attribute you created earlier in this lesson.<br />

To change the data type of the salary attribute:<br />

1 In the popup menu for the salary attribute, select View in Form<br />

and then Java Attribute Information.


Using forms to provide more information<br />

<strong>FrameWork</strong> opens the Java Attribute Information form. Notice<br />

that the Source Class field shows the class for which the<br />

attribute is defined. Notice also that the attribute has a default<br />

type of string.<br />

2 Click in the Type field.<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

99


Using forms to provide more information<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

100<br />

3 In the form shortcut toolbar at the top of the form, press the<br />

Remove button.<br />

<strong>FrameWork</strong> draws a line through the value in the Type field to<br />

indicate that it will be removed.<br />

4 In the form shortcut toolbar, press the Apply button.<br />

<strong>FrameWork</strong> removes string as the data type assigned to the<br />

salary attribute.


Using forms to provide more information<br />

5 Click again in the Type field. Then click on the arrow on the<br />

right to open a list of Java data types.<br />

6 In the list of data types, select float.<br />

7 In the form shortcut toolbar, press the Apply button.<br />

8 On the File menu, select Close to close the form.<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

101


Viewing classes using compartment notation<br />

Viewing classes using compartment<br />

notation<br />

Ways to show classes <strong>FrameWork</strong> provides two alternative notations for classes. Box<br />

notation, which you’ve been using to build your Java class<br />

diagram, displays a class as a box with the class name. The other<br />

notation, called compartment notation, shows a class as a set of<br />

three compartments and complies with the OMG UML 1.1<br />

suggested standard.<br />

Compartment notation When you view a class in compartment notation:<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

102<br />

■ The top compartment shows the class name, which can be<br />

edited in place, just as it can in box notation.<br />

■ The middle compartment lists the attributes defined for the<br />

class. Each attribute name is preceded by a graphic indicating<br />

the attribute visibility and followed by the attribute data type.<br />

■ The bottom compartment lists the operations defined for the<br />

class. Each operation name is preceded by a graphic indicating<br />

the operation visibility and followed by the operation return<br />

type.<br />

Note<br />

Visibility is the property of an object that specifies the level<br />

of access other objects have to it.<br />

So far, you’ve viewed classes only in box notation. Now you’ll view<br />

them in compartment notation.


Viewing classes using compartment notation<br />

What you do To view the classes in your Employee Hiring Classes diagram in<br />

compartment notation:<br />

1 With your Employee Hiring Classes window active, select Select<br />

All on the Edit menu.<br />

Tip<br />

To change the notation for individual classes, select only<br />

those classes.<br />

2 On the View menu, select Use Compartment Notation.<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

103


Viewing classes using compartment notation<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

104<br />

<strong>FrameWork</strong> switches the selected classes to compartment notation.<br />

After resizing and moving objects to accommodate the larger class<br />

graphics, your diagram should look something like this:


Viewing classes using compartment notation<br />

Hiding compartments When a class uses compartment notation, you can hide or redisplay<br />

one or both of the attribute and operation compartments. To hide<br />

the attribute compartment for the Employee class:<br />

1 Select the Employee class.<br />

2 On the View menu, select Show Compartments.<br />

<strong>FrameWork</strong> displays the Show Compartments dialog box.<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

105


Viewing classes using compartment notation<br />

Switching back to box<br />

notation<br />

Lesson 6: Adding More Detail to Your Java Classes<br />

106<br />

3 In the Show Compartments dialog box, click on Attributes to<br />

deselect it. Then press the OK button.<br />

<strong>FrameWork</strong> hides the attribute compartment for the Employee<br />

class.<br />

After you’ve viewed your classes using compartment notation, you<br />

can switch back to box notation at any time. To do this:<br />

1 On the Edit menu, select Select All.<br />

2 On the View menu, click on Use Compartment Notation to<br />

deselect it.


7<br />

Creating a Statechart<br />

Diagram<br />

What you’ll learn<br />

In this lesson, you’ll build a basic statechart diagram. Along the<br />

way, you’ll learn about:<br />

■ The structure of a statechart diagram<br />

Creating the diagram<br />

■ Initial states that represent starting points for objects<br />

■ States that describe the conditions of objects over time<br />

■ Transitions that show the relationships between states<br />

■ Final states that represent ending points for objects<br />

7<br />

Statechart diagrams A statechart diagram shows the changes an object can undergo<br />

during its lifetime. Objects change in response to actions<br />

performed by other objects or by themselves.<br />

Lesson 7: Creating a Statechart Diagram<br />

107


Creating the diagram<br />

Lesson 7: Creating a Statechart Diagram<br />

108<br />

In this lesson, you’ll build a statechart diagram for objects in the<br />

Applicant class you created in Lesson 5, “Creating a Java Class<br />

Diagram.” Your statechart diagram will show the sequence of<br />

states a job applicant goes through within your hiring system.<br />

Specifically, it will show the changes of state during a screening<br />

process that concludes with an applicant being rejected or hired or<br />

not accepting an offer that is made.<br />

You’ll create your statechart diagram as a subdiagram of the<br />

Applicant class. That way, you’ll be able to open the diagram by<br />

double-clicking on Applicant in your Employee Hiring Classes<br />

diagram.<br />

What you do To build your statechart diagram:<br />

1 Open the Employee Hiring Classes diagram if it’s not open<br />

already.<br />

2 With your <strong>Learning</strong> <strong>FrameWork</strong> folder highlighted, click right<br />

on the Applicant class to open its popup menu. Then select New<br />

Subdiagram and More.


Creating an initial state<br />

3 In the New Diagram dialog box, select UML Statechart. Then<br />

press the OK button.<br />

4 In the Open New Diagram dialog box, name the statechart<br />

diagram Applicant. Then press the OK button.<br />

<strong>FrameWork</strong> opens a modeling window for the new diagram.<br />

5 If the Show Tool Folders button ( ) in the standard toolbar is<br />

not pressed in, click on it to open the Statechart Diagram Tools<br />

tool folder.<br />

Creating an initial state<br />

Initial states An initial state indicates a starting point for a statechart diagram<br />

(for example, the point at which the object is created). The object is<br />

never actually in an initial state. Rather, the initial state provides<br />

an anchor for the transition to the first state in a series of state<br />

transitions.<br />

What you do You’ll begin your Applicant statechart diagram by placing an initial<br />

state in the window. To do this:<br />

1 In the Statechart Diagram Tools tool folder, click and hold on<br />

the Initial State tool.<br />

2 Move your cursor to the center left portion of the Applicant<br />

modeling window and release the mouse button.<br />

3 Name the initial state Resume Submitted. Then click on the<br />

window background to close the edit box.<br />

Lesson 7: Creating a Statechart Diagram<br />

109


Creating states<br />

Creating states<br />

Lesson 7: Creating a Statechart Diagram<br />

110<br />

Your Applicant diagram should look something like this:<br />

States A state represents a condition that describes an object for some<br />

finite amount of time.<br />

What you do To create states in your Applicant diagram:<br />

1 In the Statechart Diagram Tools tool folder, click and hold on<br />

the State tool.


Creating states<br />

2 Move your cursor above and to the right of the initial state<br />

graphic in the Applicant modeling window and release the<br />

mouse button.<br />

3 Name the state Initially Qualified. Then click on the window<br />

background to close the edit box.<br />

Your diagram should look something like this:<br />

4 Using the procedure in steps 1 through 3, add three more states<br />

named Rejected, Not Interested, and Hired below the Initially<br />

Qualified state. Then add four states named Tested, Fully<br />

Qualified, Interviewed, and Offered in the right side of the<br />

window<br />

Lesson 7: Creating a Statechart Diagram<br />

111


Creating states<br />

Lesson 7: Creating a Statechart Diagram<br />

112<br />

When you’re done, your Applicant diagram should look something<br />

like this:


Creating transitions<br />

Creating transitions<br />

Transitions Transitions show the ways in which objects can change from one<br />

state to another. In your Applicant diagram, you want to show how<br />

the initial state provides an anchor for the transitions to the first<br />

states in the series, Initially Qualified and Rejected. Then you want<br />

to show the sequence of transitions to each subsequent state.<br />

What you do To add transitions to your statechart diagram:<br />

1 In the Statechart Diagram Tools tool folder, click and hold on<br />

the Transition tool.<br />

2 Move your cursor to the initial state in the Applicant modeling<br />

window and release the mouse button. Then click on the<br />

Initially Qualified state.<br />

<strong>FrameWork</strong> draws the transition graphic and opens an edit box<br />

for the name of the event that triggers the transition.<br />

3 Name the event resume accepted. Then click on the window<br />

background to close the edit box.<br />

4 Using the procedure in steps 1 through 3, create a second<br />

transition from the initial state to the Rejected state. Name the<br />

triggering event for this transition resume rejected.<br />

Lesson 7: Creating a Statechart Diagram<br />

113


Creating transitions<br />

Lesson 7: Creating a Statechart Diagram<br />

114<br />

With these transitions in place, your diagram should look<br />

something like this:<br />

Try it yourself Now try creating transitions on your own. Using the names of the<br />

states to guide you, try creating transitions that make sense in the<br />

context of your hiring system. For example, you would test only<br />

initially qualified applicants, which in turn can result in some<br />

applicants being rejected and others being considered fully<br />

qualified. Additionally, only applicants who have received a job<br />

offer can say that they’re not interested.<br />

Tip<br />

Don’t worry if you can’t think of a name for the event that<br />

triggers a transition. Just click on the window background to close<br />

the edit box.


Creating final states<br />

Creating final states<br />

When you’re done, your diagram should look something like this:<br />

Final states A final state indicates an ending point for a statechart diagram<br />

(for example, the point at which the applicant is rejected). As with<br />

an initial state, the object is never actually in a final state. Rather,<br />

the final state provides an end point for the transition from the last<br />

state in a series of state transitions.<br />

You’ll complete the Applicant diagram by creating two final states:<br />

one indicating that the applicant has been hired and another<br />

indicating that the applicant has not.<br />

Lesson 7: Creating a Statechart Diagram<br />

115


Creating final states<br />

What you do To create the two final states in the Applicant diagram:<br />

Lesson 7: Creating a Statechart Diagram<br />

116<br />

1 In the Statechart Diagram Tools tool folder, click and hold on<br />

the Final State tool.<br />

2 Move your cursor below the initial state between the Rejected<br />

and Not Interested states and release the mouse button.<br />

3 Click on the window background to close the edit box without<br />

typing a name for the final state. Final states typically don’t<br />

have names.<br />

4 Using the procedure in steps 1 through 3, create another final<br />

state below the one you’ve already created and to the left of the<br />

Hired state.<br />

5 Create transitions from both the Rejected and Not Interested<br />

states to the first final state you created.<br />

Tip<br />

Transitions to final states typically don’t have triggering<br />

events.<br />

6 Create a transition from the Hired state to the second final state<br />

you created.


Creating final states<br />

Your finished Applicant diagram should look something like this:<br />

Lesson 7: Creating a Statechart Diagram<br />

117


8<br />

Exploring What You’ve<br />

Done<br />

What you’ll learn<br />

In this lesson, you’ll take a different view of the work you’ve done in<br />

the preceding lessons. Along the way, you’ll learn about:<br />

■ Using forms to navigate through the KnowledgeBase<br />

■ Using queries to retrieve information from the KnowledgeBase<br />

■ Running reports on your models<br />

Navigating with forms<br />

8<br />

In Lesson 6, “Adding More Detail to Your Java Classes,” you saw<br />

how you can use forms to view and modify information about the<br />

objects you create. And you saw that a form for one object can show<br />

other related objects as well. For example, you saw that the Java<br />

Attribute Information form shows the class for which an attribute<br />

is defined.<br />

Lesson 8: Exploring What You’ve Done<br />

119


Navigating from fields<br />

Navigating from fields<br />

Lesson 8: Exploring What You’ve Done<br />

120<br />

You can view information about any object already showing on a<br />

form by opening another form. You can do this directly from the<br />

form that’s already open. You don’t need to go back to the modeling<br />

window. By opening one form from another, you can navigate the<br />

information paths established in the KnowledgeBase by the<br />

connections you’ve created among the objects in your models.<br />

You can navigate from form to form either directly from the fields<br />

on the forms or by using the form navigation toolbar. In this lesson,<br />

you’ll try both techniques.<br />

Your navigation path To practice navigating directly from the fields on forms, you’ll start<br />

by looking at information about the Person class. You created this<br />

class in Lesson 5, “Creating a Java Class Diagram.” From there,<br />

you’ll look at information about a subclass of this class and an<br />

operation defined on that subclass.<br />

When you navigate directly from fields, <strong>FrameWork</strong> opens each<br />

form in a new window. These windows remain open until you close<br />

them, so you can easily return to any them by clicking on its<br />

workbook tab in the Project Workspace or selecting it on the<br />

Window menu.<br />

What you do To look at information about Person:<br />

1 Open your Employee Hiring Classes diagram if it’s not open<br />

already.<br />

2 In the popup menu for the Person class, select View in Form and<br />

then Java Class Information.<br />

<strong>FrameWork</strong> opens the Java Class Information form for Person.<br />

This form tells you about the associations, attributes, and<br />

operations defined for the class. It also lists the direct<br />

superclasses and subclasses of the class. You’ll look at<br />

information about the Employee class now.


Navigating from fields<br />

3 In the Direct Subclasses field on the Java Class form, click right<br />

on Employee to open its popup menu. Then select View in Form<br />

and Java Class Information.<br />

<strong>FrameWork</strong> opens the Java Class Information form for the<br />

Employee class. You should now have two open windows that<br />

use this form — one for the Person class and one for the<br />

Employee class.<br />

4 Continue navigating by opening the Java Operation<br />

Information form for the Orient New Hire operation.<br />

Lesson 8: Exploring What You’ve Done<br />

121


Using the form navigation toolbar<br />

Using the form navigation toolbar<br />

Your navigation path Now you’ll practice navigating with the form navigation toolbar.<br />

You’ll start by looking at information about the subsystem you<br />

created in Lesson 2, “Creating Your First Use Case Diagram.”<br />

From there, you’ll look at information about a use case within this<br />

subsystem and another use case incorporated in that one.<br />

Lesson 8: Exploring What You’ve Done<br />

122<br />

When you use the toolbar to navigate through forms, <strong>FrameWork</strong><br />

opens each form you request in the same window. As a result, only<br />

one form is open at a time. However, <strong>FrameWork</strong> keeps a list of the<br />

forms you open in the window, so you can return to them just as<br />

easily as if they were still open.<br />

What you do To look at information about the Employee Hiring subsystem:<br />

1 Open your Employee Hiring System diagram if it’s not open<br />

already.<br />

2 On the popup menu for the Employee Hiring subsystem, select<br />

View in Form and then Basic Subsystem Information.<br />

3 On the View menu, select Form Navigation Toolbar.<br />

<strong>FrameWork</strong> displays the form navigation toolbar at the top of<br />

the Basic Subsystem Information form. The object field in the<br />

toolbar shows the subsystem for which you opened the form.


Using the form navigation toolbar<br />

4 In the Use Cases field on the form, click on the Hire Employees<br />

use case.<br />

Notice that the object field in the form navigation toolbar now<br />

shows the use case you just selected.<br />

5 In the form navigation toolbar, click on the arrow in the form<br />

field (to the left of the object field) to open a list of the forms on<br />

which you can display the selected use case. Then scroll down<br />

and select Composite Use Case Object.<br />

Lesson 8: Exploring What You’ve Done<br />

123


Using queries<br />

Lesson 8: Exploring What You’ve Done<br />

124<br />

6 In the form navigation toolbar, click on the Open tool.<br />

<strong>FrameWork</strong> opens the Composite Use Case Object form for the<br />

Hire Employees use case in the same window you’ve been<br />

working in.<br />

7 Use the form navigation toolbar to open the Use Case<br />

Information form for the Interview Candidates capability.<br />

Try it yourself Take a few minutes to explore the objects you’ve created in your use<br />

case, statechart, and Java class diagrams. <strong>FrameWork</strong> comes with<br />

forms for viewing all types of objects. Try to use both of the<br />

navigation techniques you’ve just learned. Experiment with the Go<br />

Back ( ), History ( ), and Go Forward ( ) buttons in the form<br />

navigation toolbar.<br />

Using queries<br />

Tip<br />

You can also explore the objects in the DemoExample<br />

KnowledgeBase, which you used in Lesson 1, “Navigating<br />

<strong>FrameWork</strong>.” Many of these objects have more detail than the<br />

objects you’ve created in this tutorial.<br />

Queries A query is a request to <strong>FrameWork</strong> to retrieve information from<br />

the KnowledgeBase. To make the request, you invoke the query for<br />

a specific object. This is called evaluating the query on the object.<br />

Like forms, each query is defined to work on a particular type of<br />

object.<br />

How queries work A query works by using associations to navigate through the<br />

KnowledgeBase and by using set operations to manipulate objects<br />

along the way. The result of a query is a set of objects. Because of<br />

the operations they perform, queries are often able to retrieve<br />

information that is not directly available for an object.


Using queries<br />

What you do In this lesson, you’ll evaluate queries on the Qualified Candidate<br />

class in the Employee Hiring Classes diagram. To do this:<br />

1 Open the Employee Hiring Classes diagram if it’s not open<br />

already.<br />

2 Select the Qualified Candidate class.<br />

3 On the Queries menu, select Evaluate.<br />

<strong>FrameWork</strong> opens the Evaluate Query dialog box. The<br />

Evaluate field lists the queries you can evaluate on the Qualified<br />

Candidate class.<br />

4 In the Evaluate field, scroll down to find the CLASS superclasses<br />

query. Then double-click on it.<br />

Lesson 8: Exploring What You’ve Done<br />

125


Using queries<br />

Lesson 8: Exploring What You’ve Done<br />

126<br />

The CLASS superclasses query retrieves all the classes from<br />

which a class inherits properties. <strong>FrameWork</strong> shows you the<br />

result of this query for the Qualified Candidate class in the<br />

Result field.<br />

5 Now scroll back up to find the CLASS all functions query and<br />

double-click on it. This query retrieves all the associations and<br />

attributes that the Qualified Candidate class either inherits or<br />

has defined for it. Again, <strong>FrameWork</strong> shows you the result in<br />

the Result field.


Running reports<br />

6 Press the Close button to close the Evaluate Query dialog box.<br />

Try it yourself Now that you’ve learned how to evaluate queries, take a few<br />

minutes to evaluate queries on other objects in the diagrams you’ve<br />

built. When you’re finished, close all open Evaluate Query dialog<br />

boxes.<br />

Running reports<br />

Tip<br />

You can experiment more by evaluating queries on objects in<br />

the DemoExample KnowledgeBase.<br />

HTML-based reports A report is a formatted presentation of information retrieved from<br />

the KnowledgeBase. <strong>FrameWork</strong> reports use HTML to define their<br />

format. To view or print these reports, you can use any application<br />

that lets you open HTML documents.<br />

Lesson 8: Exploring What You’ve Done<br />

127


Running reports<br />

Lesson 8: Exploring What You’ve Done<br />

128<br />

In this exercise, you’ll run a report on the classes in the Employee<br />

Hiring Classes diagram you built in Lessons 6 and 7. The name of<br />

the report is Java.<br />

What you do To run the Java report:<br />

1 Use the Output option on the View menu to open the Output<br />

window on the <strong>FrameWork</strong> desktop if it’s not open already.<br />

2 Open the Employee Hiring Classes diagram if it’s not open<br />

already.<br />

3 Click on the background in the diagram window to ensure that<br />

no objects are selected.<br />

4 On the Tools menu, select Reports.<br />

<strong>FrameWork</strong> opens the Reports dialog box.<br />

5 In the Reports dialog box, select Java. Then press the Generate<br />

button.


Running reports<br />

While creating the report, <strong>FrameWork</strong> shows you its progress<br />

on the Generated Output page of the Output window.<br />

Viewing the report <strong>FrameWork</strong> writes the Java report to a directory named<br />

Java_EmployeeHiringClasses. This directory is a subdirectory of<br />

the PtechACG directory in the current root directory. If the current<br />

root directory is on your C: drive, the directory path for the report<br />

files is C:\PtechACG\Java_EmployeeHiringClasses.<br />

The name of the main report file is index.html. Use an HTML<br />

browser to open this file. The opening page of the report should<br />

look something like this:<br />

Lesson 8: Exploring What You’ve Done<br />

129


Running reports<br />

Lesson 8: Exploring What You’ve Done<br />

130<br />

To view the information on a class (for example, the Employee<br />

class), click on the class name in the left frame of the report. The<br />

Employee information should look something like this:<br />

continued


Running reports<br />

Lesson 8: Exploring What You’ve Done<br />

131


What you’ll learn<br />

Generating Code<br />

In this lesson, you’ll generate Java code from the Java class<br />

diagram you built in Lessons 5 and 6. Along the way, you’ll learn<br />

about:<br />

■ Using forms to provide language-specific information about<br />

objects in your models<br />

■ Generating Java class definitions<br />

Although this lesson shows the generation of Java code, both<br />

<strong>Technology</strong> and Enterprise <strong>FrameWork</strong> also include support for<br />

generating C++ and CORBA IDL class definitions. Additionally,<br />

Ptech offers code generation products for other development<br />

environments (including Orbix, OrbixWeb, and Forté). These<br />

products are all fully integrated with <strong>FrameWork</strong>.<br />

Tip Don’t worry if you’re not familiar with Java. You can still do<br />

this lesson, and the techniques you learn will apply to your own<br />

development environment as well.<br />

9<br />

9<br />

Lesson 9: Generating Code<br />

133


Using the Java Class Information form<br />

Using the Java Class Information form<br />

The Java Class form While building your diagrams, you can provide language-specific<br />

information about the objects in them. You provide this<br />

information by using forms. In this lesson, you’ll use the Java<br />

Class Information form to provide some additional information<br />

about the Person class in your Java class diagram.<br />

What you do To provide Java-specific information about the Person class:<br />

Lesson 9: Generating Code<br />

134<br />

1 Open the Employee Hiring Classes diagram if it’s not open<br />

already.<br />

2 Open the Java Class Information form for the Person class.<br />

3 Click in the Visibility field. Framework displays an arrow on<br />

the right side of the field.<br />

4 Click on the arrow to open the list of visibility options and select<br />

private.<br />

5 Select the Leaf option.<br />

6 In the form shortcut toolbar, press the Apply button ( ).<br />

7 Close the form.


Generating code<br />

Generating code<br />

What you do To generate Java code for the classes in your Employee Hiring<br />

Classes diagram:<br />

1 Open the Output window if it’s not open already.<br />

2 Open the Employee Hiring Classes diagram if it’s not open<br />

already.<br />

3 Click on the background of the Employee Hiring Classes<br />

window to ensure that nothing is selected.<br />

4 On the Tools menu, select Code Generation.<br />

5 In the Code Generators dialog box, select Java. Then press the<br />

Generate button.<br />

Lesson 9: Generating Code<br />

135


Generating code<br />

Where to find the<br />

generated code<br />

Lesson 9: Generating Code<br />

136<br />

While generating code, <strong>FrameWork</strong> reports its processing<br />

status on the Generated Output page of the Output window.<br />

<strong>FrameWork</strong> stores the generated Java files in subdirectories of a<br />

directory named Java. The Java directory itself is a subdirectory of<br />

the PtechACG directory in the current root directory. If the current<br />

root directory is on your C: drive, the directory path for the code<br />

generation files is C:\PtechACG\Java. You can use any text editor<br />

to view these files.


What’s Next?<br />

<strong>Learning</strong> more about <strong>FrameWork</strong><br />

You’ve now completed the lessons in this book. You’ve learned<br />

many basic modeling concepts and become familiar with the tools<br />

you use to build models in <strong>FrameWork</strong>. You’re ready to start<br />

modeling your own business systems and applications. You’re also<br />

ready to learn about the more advanced features of <strong>FrameWork</strong>.<br />

Some of these features are summarized under “Additional<br />

<strong>FrameWork</strong> features” below.<br />

Note<br />

Some of the features described may require different Ptech<br />

product licenses.<br />

As you build your models, your sources of information will be Using<br />

<strong>FrameWork</strong>, Modeling with <strong>Technology</strong> <strong>FrameWork</strong>, and the<br />

<strong>FrameWork</strong> online help. To help you be successful with<br />

<strong>FrameWork</strong>, Ptech offers both training classes and consulting<br />

services. For more information about these offerings, please<br />

contact your Ptech sales representative.<br />

10 11<br />

What’s Next?<br />

137


Additional <strong>FrameWork</strong> features<br />

Additional <strong>FrameWork</strong> features<br />

Using external graphics <strong>FrameWork</strong> supports the use of third-party and user-created<br />

graphics. You can import graphics stored as Windows metafiles<br />

(.wmf or .emf files) and then use them as icons for the objects in<br />

your diagrams. This capability gives you great flexibility in<br />

building diagrams that are specific to your problem domain,<br />

visually appealing, and easy to understand.<br />

Linking to other<br />

applications<br />

What’s Next?<br />

138<br />

To support or supplement your models, you can create links<br />

between KnowledgeBase objects and documents you create using<br />

other applications. Once you create such a link, you can open the<br />

document in its own application from within <strong>FrameWork</strong>. You can<br />

use this feature, for example, to link a class or operation in<br />

<strong>FrameWork</strong> with a Microsoft Word or video file that further<br />

documents it.<br />

Verifying models <strong>FrameWork</strong> includes a testing capability that allows you to verify<br />

that your models correctly represent your application processes.<br />

With this capability, you create samples of the objects in your<br />

classes and run them through the processes you’ve modeled,<br />

checking for expected and unexpected outcomes. Testing your<br />

models can help ensure the success of your application designs.<br />

Creating your own forms <strong>FrameWork</strong> forms are an integral part of the tools you use to build<br />

and verify your models. <strong>FrameWork</strong> comes with a set of forms that<br />

allows you to view information about all types of objects. With<br />

Enterprise <strong>FrameWork</strong> Professional, you can create new forms, so<br />

you can add, modify, and view information in the way that best<br />

meets your needs.


Additional <strong>FrameWork</strong> features<br />

Creating your own queries <strong>FrameWork</strong> KnowledgeBase queries are powerful tools that can<br />

help you examine the relationships among the objects in the<br />

KnowledgeBase and retrieve useful information that would<br />

otherwise be difficult to obtain. In addition to using the queries<br />

included with <strong>FrameWork</strong>, you can use Enterprise <strong>FrameWork</strong><br />

Professional to create your own queries. By creating queries to<br />

retrieve information specific to your application objects, you<br />

increase the value of the models and objects stored in the<br />

KnowledgeBase.<br />

Defining new model types<br />

and tools<br />

Sharing KnowledgeBase<br />

information<br />

With Enterprise <strong>FrameWork</strong> Professional, you can extend and<br />

customize the <strong>FrameWork</strong> modeling environment in a variety of<br />

ways. For example, you can modify the rules and constraints that<br />

govern how you build models to support additional application<br />

development concepts and modeling techniques. You can even<br />

define new types of models with components that meet the specific<br />

needs of your enterprise. With simple drag-and-drop actions, you<br />

can create new tools and use them to add new objects and<br />

relationships to the KnowledgeBase.<br />

<strong>FrameWork</strong> includes an import/export facility that allows you to<br />

share information with other users. With this facility, you can<br />

export diagrams, query definitions, metamodel extensions, and<br />

other objects you create from one KnowledgeBase and import them<br />

into another. You can use this facility to reduce duplication of<br />

effort and to support the cooperative development of your business<br />

applications.<br />

What’s Next?<br />

139

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!