Home

UML Guide

image

Contents

1. i Properties Association fridgeModel E Mame fridgeModei Stereotype Association Ends 3 Click here to access properties for the Tail End n Association End Head End ModelEnal 4 Type a value here or click to select one from The list Marne ModetEna Stereotype Note To modify the value later repeat these steps or simply double click the multiplicity label in the diagram to edit it in place Os Cancel 5 9 suJDJODIQ SSDID S 5 2 4 2 Generalizations A generalization shows a relationship between a base element and a derived element For T example you can show that FridgeModel is a derived class of Appliance by drawing a generalization between them As seen in Figure 5 10 the line for a generalization has a hollow tipped arrow pointing towards the base element For more information on the concept of generalizations see Section 4 2 5 2 Figure 5 10 Generalization Generalization Appliance FridgeModel BT Derived element lt lt output gt gt fridqeTemperature Temperature lt lt output gt gt doorSensor CSTypelnt 5 2 4 3 Dependencies A dependency shows that one model element uses is dependent on another For Fl example you could show that a Thermostat depends on a ThermostatDial A depen i dency appears as a dashed line with an arrowhead pointing towards the class that is depended on from Thermostat to ThermostatDial as seen in Figure 5 11 Two com
2. This document describes how to create UML diagrams with Constellation and use them in your development process While some basic UML concepts are described here this guide is not intended as a primer on UML There are several good books available on UML including Sinan Si Alhir s UML in a Nutshell A Desktop Quick Reference Nutshell Handbook n p O Reilly amp Associates 1998 Why Use UML Diagrams in Constellation Applications UML allows you to create a multi level view of your system using a language that can be used throughout the project by architects and developers alike With UML you can isolate low level implementation details to create a system level understanding UMI s strength is its ability to provide a common visual language to convey system artifacts uouonpoilul 1 2 Its widespread use also makes it a known language you can create a UML diagram of your system and expect most developers from your team and outside to understand the design UML can be used throughout a project s lifecycle depending on your engineering pro cess You can use UML in the early phases to map high level requirements structure and behavior Using UML instead of going straight to implementation allows you to focus on the abstract nature of the system and its building blocks This is particularly important for complex projects During project execution implementation often needs to deviate from design for rea sons such as in
3. monly used stereotypes for dependencies are lt lt includes gt gt and lt lt extends gt gt see Section 4 2 5 3 for details Figure 5 11 Dependency lt lt Cog gt gt lt lt input gt gt fridge Temperature Temperature ThermostatDial input doorSensor CSTypelnt lt lt provides gt gt setThermostatValue int lt lt provides gt gt setThermostat setting int void Thermostat depends on ThermostatDial 5 10 Chapter 6 Sequence Diagrams 6 1 Concepts A sequence diagram models the interactions among objects and modules in your sys tem by showing you a time line of the messages sent among them They are frequently used in parallel with class diagrams which model the structure of the system to show the order of method calls among objects However they can also be used to model at a very high level the semantic interactions among roles played by objects whose types have yet to be specified In this capacity sequence diagrams may be used in parallel with use case diagrams For example consider the refrigerator we have been modeling Suppose that you are in the project s early design phase and have a use case diagram showing a user opening and closing the refrigerator door as seen in Figure 4 1 Note however that the use case diagram specifies neither the steps required to perform these tasks nor the ordering of these steps A high level sequence diagram is well suited to capture just
4. I I I I I I I I I I I I I E li Y 4 b This sequence diagram is provided in the rti tutorial repository in the FridgeSimulation COG The user turns the thermostat dial to select a temperature Based on the temperature selected the dial instructs the compressor and light switches to turn on sets the maximum and minimum temperatures and returns control to the user 6 2 Model Elements 6 2 Model Elements Figure 6 2 shows the types of model elements you can include in sequence diagrams Comments and their anchors are also allowed in class diagrams and therefore are described in Chapter 5 The two most important model element types in sequence dia grams are classifier roles Section 6 2 1 and messages Section 6 2 2 For general information on how to work with diagrams and model elements see Section 3 5 and Section 3 6 respectively Figure 6 2 Drawing Toolbar for Sequence Diagrams 6 2 1 Select Section 3 6 1 Classifier Role Section 6 2 1 Actor Section 6 2 1 Comment Section 5 2 3 Message Section 6 2 2 Anchor to Comment Section 5 2 3 To insert one of these model elements click the button to select then click inside the workspace To insert more than one double click the button then click multiple times in the workspace Classifier Roles A classifier role represents a semantic role played by an object in your system Like an object it may have a name a base type and so
5. RTI Constellation 1 0d cs 8 0u repositories rti_tutorial cogs FridgeSy nu ati pniFridgeSimulationimi E La al xd Window Tool Help UML T Eri E mle ajaja sa ze sale plementation Requirements Structure Behavior E overview E Temperature contro I H lt lt Cog gt gt pa lt lt Cog gt gt 3 Thermostat H E mi network e 3 rti netvvork examples G E rti tutorial i types methods interfaces atcs dfcs stcs maA EBEEEEEEE t 8 amp fsms i cogs BR Fridg 1 18 FridgeSimulati FridgeSimu E FridgeSim i388 SimulinkFridge 38e Thermostat t3 applications L3 simulink Repository Opened UML Models Definition Current UML Model ierarchical views user User lt lt uses gt gt setThermostat setting int void uses lt lt Cog gt gt lt lt CSinterface gt gt Door Click here to be able to select objects in the workspace or to unstick a drawing tool How a drawing tool appears when clicked one time for creating a single element in the workspace FridgeSimulation fridgeModel FridgeModel lt lt input gt gt fridgeTemperature Temperature lt lt input gt gt doorSensor CSTypelnt lt lt provides gt gt setThermostat setting int void p open void lt lt output gt gt fridgeTemperature Temperature close void lt lt output gt gt doorSensor CST
6. a long string of numbers and other characters to the UUID of the model element s home work unit LJ A work unit index work unit index xml maps work unit UUIDs to the reposi tory relative paths of the work units in that repository LJ Finally an implementation index REPOSITORY INDEX maps the names of implemented work units to the repository relative paths of implementation dia gram files Since the names of implementation diagrams serve as programmatic identifiers they must be unique within a repository For more information see Section 5 2 1 in the Constellation User s Manual Work Unit Mechanics Creating Work Units A new empty work unit can be created anywhere in a repository a new work unit that will contain an implementation diagram must be created in the repository sub folder appropriate for its implementation type cogs atcs etc For example to create a work unit that includes a COG implementation diagram select the Repository tab right click the appropriate cogs folder and select New Work Unit from the pop up menu You will see a new folder inside it will be all of the files initially belonging to the new work unit Then you can add class use case and sequence dia grams to it by using the buttons in Figure 3 5 To create a work unit that will not contain an implementation diagram select the Repository tab right click any folder and select New Work Unit No Component from the pop up menu Op
7. grams described in Chapter 5 I Implementation diagrams These diagrams capture the implementation details at a higher level than the final code Use of these diagrams depends heavily on the underlying frameworks All the component types supported by Constellation ATCs DFCs STCs COGs FSMs and Applications fall in this category Connector types types meth ods and interfaces also fall into this category For descriptions of Constellation components and connectors see the Chapter 2 in the Constellation User s Man ual Although each type of diagram has a clear place in the project life cycle each can be and often should be used in other phases as well For example it is common for struc tural diagrams to be modified during the implementation phase to align them with the implementation l uouyonpoilu 1 2 1 1 2 2 1 4 Supported UML Diagrams Constellation supports the most widely used diagrams from UML LJ Use Case Diagrams described in Chapter 4 J Class Diagrams described in Chapter 5 lI Sequence Diagrams described in Chapter 6 L1 Component Diagrams described in Section 1 2 2 and Section 2 3 in the Constel lation User s Manual LJ State Machine Diagrams described in Section 1 2 3 and Section 2 3 in the Con stellation User s Manual Component Diagrams Constellation supports two kinds of executable component diagrams COGs and FSMs These diagrams not only provide the design view of the
8. offer a richer set of semantics specifically for indicating provision and utilization of methods data flow and other important information COGs are described in Chapter 7 in the Constellation User s Manual Implementation The additional semantics in component diagrams make them somewhat unsuited for the early stages of requirements analysis and software design You may want to docu ment that a role needs to be fulfilled and what relationships that role s type has to other hypothetical types without committing to a particular kind of implementation How do you make the transition from class models to executable components Once the transi tion has been made how can you compare the final product with the initial design To solve this problem Corstellation offers a simple wizard interface to create a compo nent from any class You can synchronize the contents of the class and the component to the extent you choose Afterwards the connections between the class and the compo nent will be remembered you can immediately jump from any class to the component that implements it or from a component to the class that documents its structural design For more information on using this tool refer to Chapter 7 If your initial design and current implementation start to grow apart you may wish to resynchronize them with one another to indicate that the implementation changes have been accepted into the component s specification and to provide skele
9. 1 4 1 1 8 that describes the particulars of the control algorithm with trajectory planning and con trol elements that refer to the first work unit Suppose members of your team are editing different work units simultaneously and you have a work unit that refers to them When the other work units are complete you can pick up their changes simply by updating the referencing work unit For more information on work units see Chapter 3 Model A model is a coherent collection of model elements used for a particular purpose With Constellation this purpose is most likely the design and implementation of an applica tion or a set of applications Because of the highly reusable nature of Constellation s com ponent approach the model of your application will likely span many work units and even many repositories Types of Model Elements Design and Implementation There are two kinds of model elements IH Design Model Elements Section 1 4 1 L1 Implementation Model Elements Section 1 4 2 In a typical software engineering process both kinds of elements go through several phases of modification These changes are often necessitated by new requirements the discovery of certain implementation issues or during an effort to reduce a system s complexity Chapter 2 discusses this iterative development process Constellation makes it easy to navigate between UML model elements diagrams tradi tional Constellation components and ot
10. 4 properties 3 11 reusing 3 11 use cases 4 4 visual properties 3 11 multiplicity 5 8 Index 2 N navigable 5 7 O oval 4 4 P packages 4 4 R rectangle 5 3 red circle meaning of 3 2 relationships 4 5 extends 4 10 includes 4 9 requirements diagrams 1 2 2 2 reusing model elements 3 11 reusing work units 3 2 reverse engineering 7 9 S sequence diagrams 2 5 6 1 classifier roles 6 3 messages 6 5 state machine diagrams 1 4 2 5 stereotypes definition 1 5 icons for 3 14 stick figures 4 3 6 5 structure diagrams 1 3 2 4 supported UML diagrams 1 4 U UML menu 3 14 use case diagrams 2 2 4 1 use cases 4 4 UUID 3 4 V visual properties 1 6 3 11 W wizard 2 7 7 1 work units creating 3 4 definition 1 6 deleting 3 8 files in 3 3 foreign 3 2 opening 3 4 reusing 3 2 saving 3 8 Index 3 Index 4
11. 5 1 5 1 Iii 5 1 52 Model Femi cc Lm 5 3 5 2 1 Clipper 5 3 022 Interfaces erm oe m dva uns em mE 5 4 520 Ciad 5 4 5 2 4 ISelattolsbilDS aonana ai 5 5 Sequence DIGOIGITIS x ehem ote redibat be ebd a 6 1 6 1 Colpisci 6 1 6 2 Model Ele MENS sanpa desi baa ESsi fen boe nada detti ilari 6 3 6 2 1 Classer Roles Sere mene cere ea 6 3 6 2 2 Nessa isla 6 5 Connecting Design and Implementation in 7 1 Zl Classes and Components enrere naa tete tite eee 7 7 2 Using the Class to Component Wizard i 7 2 7 2 1 Creating a New ComponeN oiii ain on 7 2 22 2 Synchronizing a Class and a Component ees 7 9 7 2 3 Documenting an Existing Component eee 7 9 lg s c AN Index 1 vii viii Chapter Introduction to UML in Constellation 1 1 The UML or Unified Modeling Language is a language used to model the structure and behavior of real world systems frequently software systems Constellation provides support for a concrete component based software development methodology UML support in Constellation bridges the gap between an abstract model of your system in UML and concrete Constellation components You can also easily synchronize one kind of model to the other Throughout this document we will refer to a simple example that models a refrigerator You will find this example in the rti_tutorial repository
12. Properties window such as the one in Figure 3 8 To access a particular model element s properties either double click the model element in the workspace or right click it and select Model Element Properties from the pop up menu Additionally most individual model element properties including the model element name the names of class attributes and operations stereotypes and so on may be edited in place by double clicking the appropriate text A small text field will appear as seen in Figure 3 9 press Enter to commit your changes or Escape to revert them Figure 3 9 Editing a Specific Model Element Property 3 6 4 Changing How a Model Element Appears in a Diagram You can change how any depiction of a model element appears in a diagram Right click the element and select Visual Properties from the pop up menu Figure 3 10 shows the resulting dialog For information on the icon that may appear in the upper right corner see Section 3 6 5 3 11 SHUN HOM E Figure 3 7 Working with Diagrams Tabs for selecting different h 3 12 Tabs for each diagram in the selected category File Edit Arrange View Go j gt ajale repo a cs_core H E HMFExample a rti_cortrol H E rti cruiseDemo J rti cscourse H E mi deprecated fa rti_drivers categories of diagrams Buttons for selecting different Buttons for adding new diagrams ta Constellation fridgeSimulation file C
13. Repair Person and the User by adding a gen eralization between them The arrow should point towards User Add an association from the Repair Person to the Repair use case Add a dependency from Repair to Access Log with an lt lt includes gt gt stereotype Now you ve completed your first use case diagram The mechanics of creating class and sequence diagrams are very similar as you will see in Chapter 5 and Chapter 6 respec tively Tutorial Figure 4 10 Example with Extends Dependency and Generalization Open Fridge 21 Fa lt lt includes gt Close Fridge User i i Change settings exterds lt lt includes gt gt E E x Access lag Repair RepairPerson 4 11 SoSD2 OSN 7 4 12 Chapter 5 Class Diagrams 5 Concepts Class diagrams are perhaps the most commonly used type of UML diagram They cap ture the structural relationships between various elements in a system without model ing too many of the implementation details They are generally used starting with the architecture phase all the way through the implementation phase Class diagrams can also be used to reverse engineer an implemented system producing documentation of the system s high level architecture By capturing only essential elements a good class diagram facilitates understanding at the right level of granularity It is common for a work unit to co
14. Stereotype e Default Interface Icon interface C Name on void Operations off void Comments A comment model element allows you to attach simple documentation to any model ele ment in a diagram Comments are typically used to describe certain characteristics that are not otherwise apparent Select the Comment tool from the drawing toolbar and click near the model element you want to comment Double click the text of the comment and type whatever docu mentation you desire When you are finished typing click outside the text box to com Model Elements Figure 5 5 5 2 4 5 2 4 1 mit your change or press Escape to revert your changes Select the Anchor to Comment tool and use it to draw a line between your new comment and the model ele ment to which it refers as seen in Figure 5 5 Comment Enter comments here lt lt Cog gt gt in FridgeSimulation Relationships The types of relationships you can show between elements in a class diagram include I Generalizations Section 5 2 4 2 I Associations and Association Ends Section 5 2 4 1 L1 Dependencies Section 5 2 4 3 To draw these types of lines between two model elements select the desired button from the drawing toolbar then in the workspace simply drag the line from one model element to the other Associations and Association Ends An association is another way to show a relationship between two model elements Each ass
15. WhatareWOorSUnits nnuisianiliolba ite io nie 3 1 3 2 DOLEW are REUS Esga Ta E E duce uaa lite R 92 3 3 Fhysical SUR CLES alal 3 3 3 4 WorkUnikEMechanits ima 3 4 3 4 1 Creaune Work U TUS ocoueetecest tan Deve lai 3 4 3 4 2 Opening Existing Work Units oon o eee erdt e 3 4 3 4 3 Dav Ie VORK LIIS eerta lane 3 8 3 4 4 Destroyatie Work UNIS oie cese betae ee T N edit 3 8 3 5 Working with Class Use Case and Sequence Diagrams 3 8 3 6 Workine with Model Elements allea 3 10 3 6 1 Creatine Model Elements s etos E adest cites 3 10 3 6 2 Reusing Model ElemelbltS ode d ei tot OI Ra es 3 11 3 6 3 Changing a Model Element s Properties sss 3 11 3 6 4 Changing How a Model Element Appears in a Diagram 3 11 3 6 5 Adding Custom Stereotype Icons esee 3 14 3 6 6 Deleting Model PCI ents uote oO a 3 16 3 7 Mewane Exported Did Fats es teret idu RM rati dete Ram Re tpe 3 16 Uso Cdse DIGOICITIS bo uadit ine Re rein ates alu uto Ene nO PO 4 1 4 1 COn COD Screen eee r eee ne E eer ee ere eet 4 4 2 Modet Elements EIE 4 3 4 2 1 ACTOL lilla eta 4 3 422 Sed A E RM Pusat E A A dide 4 4 4 2 3 le p 4 4 4 2 4 SO SEES ipa 4 4 4 2 5 ISelagons psn rn 4 5 4 3 Tutorial lalla 4 8 4 3 1 Creatine Model Elements oido o ionn teni N 4 8 4 3 2 S bdividmp a Use Case iaia 4 9 4 3 3 Extendine a lse C ASE roie 4 10 sre B12 0 9 9 T
16. a relationship between two model elements select the desired button from the drawing toolbar then in the workspace simply drag the line from one model element to the other The direction of the line matters and is discussed in each of the following sec tions For practice follow along with the tutorial in Section 4 3 Associations An association shows a relationship in which two model elements know about or are affiliated with each other In this type of relationship the model elements have explicit knowledge of each other In Figure 4 5 the RepairPerson actor is associated with the Repair use case Contrast this with the dependency relationship Section 4 2 5 3 in which one model element uses another An association is a stronger type of relationship than a dependency Generalizations A generalization shows a relationship between two model elements in which one is a base model element and the other is a derived model element In a use case diagram the derived model element inherits behavior from the base Another way to think of gener alizations is that the derived element s behavior is a subset of the base element s behav 4 5 SOSD2 esf p Figure 4 5 Association Hepair RepairPerson Association ior In our refrigerator example the repair person inherits the behavior of a user that is a repair person does all the same things as a normal user plus other actions The line for a generalization has a hollo
17. depiction of the class in any diagram and select Imple ment as seen in Figure 7 1 this command will start the wizard Figure 7 1 Implementing a Class lt lt household machines gt gt MyFridge Visual Properties minTemp Simchanze With odel Element maxTemp ae v E Show Attributes defrost v Ej Show Operations Implement Show Implementation Model Element Properties Delete Model Element 2 Add StereaWpE H Add New Attribute FA Add Mew Operation The wizard helps you create pin and bubble ports for each attribute and operation in the source class As seen in Figure 7 2 you will start by selecting a type ATC DFC STC COG FSM or application and repository for your new component If you need help deciding what type of component to use see the Constellation User s Manual Or you can enter the 7 2 Using the Class to Component Wizard name and repository of an existing component in which case the Component Type field will match the existing component and become uneditable Figure 7 2 Selecting a Component Type and Location m RTI Class to Component Wizard Class MyFridge Welcome Choose Type Choose Component Type and Location Implement Pin Ports Implement Bubble Ports Please choose the type and location of a component ADS Ifa component already exists with the name and repository you choose its contents will be merged with that of the class you have select
18. items of documentation errata to errataQrti com Available Documentation Constellation documentation includes LJ The Overview Capabilities and Benefits ConstellationOverview pdf This docu ment provides an overview of Constellation s main features and discusses the benefits of using Constellation I The Getting Started Guide GettingStarted pdf This document includes installa tion instructions system requirements supported architectures and compatibil ity with other products 1 The Tutorial ConstellationTutorial pdf This tutorial provides basic exercises to give you hands on experience working in the Constellation environment to build test and run new components and applications I The User s Manual Manual pdf The manual contains step by step instructions on how to use the tools build components run and debug applications LJ The Distributed Applications Guide DistributedApplications pdf This docu ment describes two approaches NDDS and CORBA for developing Constel lation applications that need to communicate with other Constellation and non Constellation applications L The UML Guide ConstellationUMLGuide pdf This document provides an introduction to the Unified Modeling Language UML and describes how to create UML diagrams with Constellation and use them in your development pro cess You can access these documents through the main online documentation file Constella tion html which also inclu
19. of the process is not useful for your project you may leave it out This chapter provides a general description of some of the stages through which your development process may progress and the tools that you will find useful at each stage Chapter3 through Chapter 6 describe individual features of Constellation in detail Finally Chapter 7 Connecting Design and Implementation closes the loop by show ing you in detail how to leverage those features to realize the process described in this chapter 2 SSODOld Z 2 1 Requirements Analysis REQUIREMENT BEHAVIOR SPECIFICATION MODELING IMPLEMENTATION Requirements analysis is the task of determining what your finished program must do the customer needs it must address the high level features it must have and so on It is usually one of the first things to do when beginning a new project although you may revisit and refine your requirements for some time into the development cycle There are many ways to capture requirements from documents produced in a word processor or text editor to UML diagrams to databases of hierarchically structured requirements maintained by a dedicated requirements management tool Many projects will leverage a combination of approaches Constellation allows you to mix and match tools and media however you require UML use case diagrams are one useful and increasingly popular mechanism for describing the scenarios in which a prod
20. of using the tools Con stellation provides for creating use case diagrams Creating Model Elements Let s start with a very basic use case we have a User who needs to operate a refrigera tor The User will be represented by an Actor model element The use case thus far is simply Operate Fridge A Simple Use Case Diagram Operate Fridge User To create the diagram in Figure 4 8 1 Start in one of your own repositories For information on creating a repository see the Constellation User s Manual The goal of this tutorial is to create a diagram that looks like the one in the rti_tutorial repository do not write your changes in rti_tutorial 2 Create a new use case diagram using the Add New Use Case Diagram button in the toolbar that stretches across the top of the application windows seen in Figure 4 1 3 Click the use case button in the vertical drawing toolbar along the left side of the diagram just created seen in Figure 4 2 4 Click the diagram workspace to create a new use case in the work unit and place a depiction of it in the diagram 5 Double click the use case s name to open an editing field change the name to Operate Fridge and press Return 6 Now choose the actor tool in the drawing toolbar and create a new actor in the diagram in the same way Tutorial 7 Change the actor s name to User 8 Show that the actor and use case are associated with each other by selecting the assoc
21. so that it is one way turn off suJDJODIQ SSDID S navigability for the end that should not be referenced Figure 5 6 shows how to make your selection Setting an end to be not navigable adds an arrow to the opposite end so that it appears as a one way path between the elements The end without an arrow head is not navigable cannot be referenced by the other end Figure 5 8 illus trates the both types of end points Figure 5 8 Association End Arrowhead used for Navigability 5 8 lt lt Cog gt gt 282 DNE FridgeSimulation is not FridgeSimulation navigable known about by FridgeModel FridgeModel is navigable known about by FridgeSimulation FridgeModel lt lt output gt fridgeTemperature Temperature output doorSensor CSTypelnt In this example of navigability the FridgeSimulation can refer to the FridgeModel but the FridgeModel knows nothing about the FridgeSimulation I Multiplicity Association ends can also show multiplicity which indicates the number of objects of one class that are associated with an object in another class For example you can specify that a refrigerator has two doors or that a thermo stat is associated with x number of temperature sensors You can choose not to specify multiplicity at all signifying either that it is unimportant or it is undeter mined To specify a value right click the association and follow the steps in Figure 5 9 The various ways of specif
22. system but also make it easy to create an executable application This characteristic of executable readiness sets these diagrams apart from other diagrams such as class and sequence diagrams Once you have created a class or sequence diagram you still need to create an implementation out of it Obviously making a component diagram requires far more details than their higher level counterparts Therefore it is not uncommon to first create class and sequence dia grams to get a high level view and then create executable component diagrams from those One way to look at this process is that component diagrams are the implementation of structure and behavior diagrams The COG diagrams supported in Constellation are closely related to UML component diagrams A COG contains appropriate extensions to make it more accessible to the tar get application s domain and make efficient use of Constellation s framework In particu lar COG diagrams support modelling data flow behavior Constellation applications are specialized COG components that provide the definitions needed to resolve system level resources such as clocks habitats etc For more information on COGs see Chapter 7 in the Constellation User s Manual Key Terms 1 2 3 1 3 1 3 1 1 3 2 State Machine Diagrams The finite state machine diagrams FSMs supported by Constellation are closely related to UML state machine diagrams Constellation does however support
23. that informa tion Now suppose that the structure of your refrigerator application has been modeled with class diagrams The players and their APIs are well defined Your class diagrams spec ify which messages class instances should respond to but they do not specify which objects should be calling which methods when Sequence diagrams can help you in this situation as well 6 1 sevuanbas 9 This chapter describes the model elements that can be used in sequence diagrams Figure 6 1 shows a sample sequence diagram from the rti tutorial repository FridgeS imulation cog Figure 6 1 Sequence Diagram Workspace Drawing toolbar for selecting the type of model element you want to create sequence Diagrams are in Add New see ur 6 2 the Behavior category sequence Diagram Fal Constellation FridgeSimulation file C Zhome adelleZrti cs7cs 5 17repositories rti tutorial cogs FridgeSimulatinnZ FridgeSimulation mf CI X File Edi Arange View Go Window Tools Help UML S u rm e s e e epe 25 ESCO F Set Temperature D ight Switch TemperatureController ERES I lt lt provides gt gt setThermostatValue int X on void I p____ Pa PRO EREE ERE i T 1 lt lt provides gt t setMinimumTemperature temp Tempfrature void anes ical E aa oe om om oo A a c m eee eee a a lo amo I
24. use case Repair extends the use case Operate Fridge repairing a refrigerator is an extension of operating it The extending use case is unlike a subtype because it does not include the semantics of the extended use case as part of itself it provides only the addi tional information To draw an extends relationship use a dependency and add a stereotype called lt lt extends gt gt as seen in Figure 4 1 The dependency should be drawn from the extending use case to the extended use case LJ Includes An includes relationship indicates that one use case depends on another being carried out as a part of its own behavior It is somewhat analogous to aggrega tion It may denote a high level task that contains a number of sub tasks For example in Figure 4 1 we see that the use case Operate Fridge includes three other uses cases Open Fridge Close Fridge and Change Settings using a refrigerator includes opening it closing it and changing its settings To draw an includes relationship use a dependency and add a stereotype called includes as seen in Figure 4 7 The dependency should point to the included use case 4 7 SOSD2 esf p 4 3 4 3 1 Figure 4 8 4 8 Tutorial This section describes how to create the example use case diagram that is seen in Figure 4 1 and provided in the rti tutorial repository FridgeSimulation cog This will allow us to explore both the thought process and the mechanics
25. 6 5 aggregate 5 6 anchor to comment 4 4 5 4 associations 5 5 end points 5 6 attributes 5 3 base classifiers 6 5 base work units 3 2 behavior diagrams 1 3 2 5 C changing icons 3 14 class diagrams 2 4 6 5 classes 5 3 converting to components 2 7 classifier roles 6 3 adding 6 5 naming 6 4 COGs 1 4 comments 4 4 5 4 component diagrams 2 6 composibility 5 6 converting classes to components 2 7 7 1 D dependency 4 6 5 10 depictions of model elements 3 11 definition 1 6 design model elements 1 8 development process 2 1 diagrams buttons for displaying 3 5 categories of 3 5 creating 3 8 definition 1 5 3 1 exporting 3 16 opening 3 9 renaming 3 8 supported types 1 4 to 1 5 DOORS 2 2 E executable diagrams 1 4 exporting diagrams 3 16 extends relationship type 4 10 Index 1 F foreign work units 3 2 FSMs 1 4 G generalizations 4 5 5 10 green cells meaning of 3 14 green triangle meaning of 3 2 grouping model elements 4 4 icons 3 14 implementation diagrams 1 3 implementation model elements 1 9 implementing classes 7 1 includes relationship type 4 9 index files 3 4 interfaces 5 4 L lifelines 6 3 lines 4 5 M manifest file 3 3 messages 6 5 model definition 1 8 model elements actors 4 3 6 5 classes 5 3 classifier roles 6 3 6 5 comments 4 4 5 4 creating 3 10 definition 1 5 3 1 deleting 3 16 depictions of 1 6 3 11 grouping 4 4 interfaces 5 4 messages 6 5 packages 4
26. Case Sequence File Edt Arange View Go Window Tools Help UML gt Alal alale alala sara Ez e eE 3 8 An empty workspace will be displayed under a new tab labeled Untitled type Diagram where type is Class Use Case or Sequence as seen in Figure 3 6 2 Select the Current UML Model tab Working with Class Use Case and Sequence Diagrams 3 If the Model folder at the top of the tree is open expanded double click the folder to close collapse it This will make it easier to see the entries in the Dia grams folder in the next step 4 Expand the Diagrams folder to locate the Untitled type Diagram 5 Right click Untitled type Diagram and select Rename from the pop up menu as seen in Figure 3 6 6 Enter the new name and click OK Figure 3 6 Adding and Renaming a Class Diagram Add New Class Diagram i Constellation fridge Simulation file C RTL Constellation 1 0d cs 8 0d repositories rti_tutorial cogs h dgeSimulation Fri File Edit Arrange View Go Window Tool Help UML ulala sae alala se P Erg ELE A Current UML Models El fridgeSimulation Model E Diagrams dn B Overview Be E Temperature Control ek Basic Access i Set Temperature Rename Delete Add Mew Class Diagram Add Mew Use Case Diagram Add Mew Sequence Diagram Tab for Current EZ UML Model Current UML Model Repository Opened UML Models Definitio
27. Constellation A Real Time Software Framework UML Guide Constellation Version 1 0 Aeal Tima Innavatioms l re 77 Aeal Tima Janova tions Copyright 2003 Real Time Innovations Inc Printed in U S A First printing All rights reserved June 2003 Trademarks Real Time Innovations Constellation NDDS and RTI are trademarks or registered trademarks of Real Time Innovations Inc Adobe is a registered trademark of Adobe Systems Incorporated CORBA is a registered trademark of the Object Management Group Telelogic and Telelogic DOORS are registered trademarks of Telelogic AB VxWorks is a registered trademark of Wind River Systems Inc All other trademarks used in this document are the property of their respective owners Copy and Use Restrictions No part of this publication may be reproduced stored in a retrieval system or transmitted in any form including electronic mechanical photocopy and facsimile without the prior written permission of Real Time Innovations Inc The software described in this document is furnished under and subject to the RTI software license agreement The software may be used or copied only under the terms of the license agreement Technical Support Real Time Innovations Inc 155A Moffett Park Drive Sunnyvale CA 94089 Phone 408 734 4200 Fax 408 734 5009 E mail support rti com Web Site http www rti com Note Please send any omissions corrections or other
28. Constellation spe cific extensions that allow you to create reusable components and make the efficient use of Constellation framework For more information on FSMs see Chapter 8 in the Constellation User s Manual Key Terms Diagrams Think of a diagram as a canvas on which you can draw certain types of model elements Model elements are items such as classes interfaces COGs state machines and the relationships between them see Section 1 3 2 Constellation supports the following types of diagrams L1 Use Case Diagrams Chapter 4 LJ Class Diagrams Chapter 5 LJ Sequence Diagrams Chapter 6 L1 Implementation Model Elements Section 1 4 2 Model Elements A model element represents the underlying information about an entity in a system Dif ferent types of model elements are allowed in each type of diagram For instance a class diagram may contain model elements called classes interfaces packages comments and the relationships between those elements Model elements called actors and classi fier roles only appear in sequence diagrams The model elements supported in each type of diagram are described throughout the remainder of this document Model ele ments may be related to other model elements in any work unit Every model element has a name and optionally a stereotype Stereotypes allow a meta classification of model elements For example you can attach a Cog stereotype to cer tain classes to indicate tha
29. MODELING IMPLEMENTATION At some point you will be ready to begin building your executable application Typi cally you will have completed some degree of requirements analysis and structural and behavioral design prior to that point However new issues are likely to come up during implementation that necessitate reconsideration of those requirements and models Constellation does not restrict you to a linear process but facilitates iterative motion among your development stages and tasks This chapter describes the concepts involved in implementing your software based on your previous work specifics and mechanics are given in Chapter 7 Constellation offers tools for executing both behavioral and structural models As noted in Section 2 3 Constellation state machines are fully executable and support hierarchical nesting of software components State machines are described in Chapter 8 in the Con stellation User s Manual Executable structural models in Constellation take the form of component diagrams Class models are insufficient for this task because they leave crucial information unspecified For instance although they can show that classes A and B are associated and that B has an Execute method they cannot specify that A invokes Execute on B nor the order in which calls are made in with respect to other method calls that might take place Constellation component diagrams also called Composite Object Group or COG diagrams
30. adequate design incorrect assumptions performance considerations etc Therefore it is common to modify UML designs to align them with the actual imple mentation It is also useful to check that the requirements captured in a UML model are accounted for in the implementation Once a project is over it is useful to update the UML model again to provide a complete set of final documentation This can ease project maintenance and provide an accurate set of documentation for future projects that want to leverage off the project In summary the benefits of using UML modeling include LJ Better high level understanding LJ Better requirements tracking I Common way to express design intents The costs include the resources and effort to create and maintain the diagrams This includes training for team members not familiar with UML Overview of UML Diagrams Systems are described with models models are depicted and manipulated with diagrams Each UML diagram provides a view into an associated model of a system The diagrams can be classified into the following categories LJ Requirements diagrams These diagrams are geared towards capturing the requirements of a project These types of diagrams answer the question How will the final product be used Overview of UML Diagrams Use Case Diagrams Sequence Diagrams Class Diagrams Implementation and State Machine Diagrams These types of diagrams act as interfaces between t
31. ames Open Fridge Close Fridge Change Settings Double click the dependency button Draw dependency lines from Operate Fridge to each of the three new use cases Click the Select button in the drawing toolbar Double click each new dependency and add the stereotype lt lt includes gt gt Extending a Use Case Now let s add another actor to the diagram to represent a repair person A repair person inherits all the behavior of a typical user we show this relationship with a generaliza tion between them Part of the repair person s activities are to perform the repair which includes operating the refrigerator and accessing a repair log To show this we need to add two more use case model elements Repair and Access Log Since the repair process uses the Operate Fridge use case plus other steps the Repair use case extends builds on the functionality of the Operate Fridge use case This is indicated by an lt lt extends gt gt stereotype on the dependency between the Repair use case and the Operate Fridge use case as seen in Figure 4 10 To build upon Figure 4 9 to create the diagram in Figure 4 10 1 2 Add two new use cases Repair and Access Log Show that the Repair use case extends the Operate Fridge use case by adding a dependency between them with a lt lt extends gt gt stereotype The arrow should point towards Operate Fridge 3 Add a new actor named Repair Person 9 6 Show the relationship between the
32. are the same regardless of the diagram type To create a single model element and insert it in the current diagram click the but ton for the desired type then click again inside the workspace To create more than one model element of the same type double click the button mak ing it sticky then click multiple times in the workspace For instance to create three interface model elements double click the Interface button then click in the workspace three times To un stick a button click the Select tool amp The bottom of Figure 3 7 shows how these button looks when sticky Working with Model Elements 3 6 2 3 6 3 Note It is possible to create a model element in a work unit without displaying it in any diagram Do this by right clicking on a Model node in either the Current UML Model or Opened UML Models tabs of the repository browser and choose one of the Add commands from the resulting pop up menu In practice you will usually immediately insert a depiction of a model element into a diagram Reusing Model Elements To insert a depiction of an existing model element in a diagram select the model ele ment from the Current UML Model or Opened UML Models tabs then drag and drop the model element into the workspace Or you can right click the model element and choose Insert into Current Diagram from the pop up menu Changing a Model Elements Properties You can change a model element s properties by using its
33. atcs MyFridge MyFridge mf E 3 B x File Edit Arrange View Go Window Tool Help UML a m amp a m s amp e epe a 2a Form View Documentation Base Class Remave Base Class Total Sizing Parameter Count O Size Parameters NONE Show Design Pins Bubbles Interfaces Inherited Methods Fix Error Delete Move Up Move Down v Has Direct Feedthrough type Name Access Plcemet DoF Sizes Inherited BUILTINAnt minTemp preference auto 0 INONE m 7 8 Using the Class to Component Wizard 7 2 2 7 2 3 Right click a depiction of the source class model element in any diagram or in the model browser and choose Show Implementation to load and display the component created from it Click the Show Design button in the component s form view to display the class dia gram from which the wizard was last invoked Synchronizing a Class and a Component As time passes your implementation and its original design may become out of sync You may add new ports to the component change the class s name or add an attribute that wasn t originally there To synchronize them again invoke the wizard a second time right click the class and choose Implement This time you will see slightly differ ent screens As before you will have the opportunity to create new attributes and oper ations for any new ports and new ports that will correspond to any new attributes and opera
34. d Diagrams Constellation saves UML diagrams in SVG format which is XML based There is no stan dard format for UML diagrams recognized by the OMG but SVG is a strong candidate Free browser plug ins are available from Adobe so Constellation UML diagrams are easily viewable in any web browser Diagram files are named model name diagram name svg 3 16 Chapter 4 Use Case Diagrams 4 1 Concepts A use case diagram captures the scenarios in which your system will be used and the individuals involved in those scenarios It is generally used during the requirements phase of a project to model at a high level what the system will have to accomplish when it is complete This chapter describes the model elements that can be used in use case diagrams and how to add delete and modify them in Constellation Figure 4 1 shows a sample use case diagram This chapter also includes a tutorial to show you how to create this diagram The ordering of the steps in a model is important in the finished system but it is not captured by a use case diagram Use case diagrams specify only which actions the sys tem should support they do not specify how they should be supported nor do they show in what order Order of operations is captured by sequence diagrams see Chapter 6 4 1 SOSD2 esf p Figure 4 1 Use Case Diagram Workspace Use Case Diagrams are in Add New Use Case the Requirements category Diagram i Constel
35. d diagrams in one work unit can contain references to model elements in another work unit It is possible to refer to a model element in a work unit that is read only using a work unit does not require modifying it Examples of dependencies between work units include J A model element in one work unit can have a base class or derived class in another work unit J A diagram can include a depiction of a model element from another work unit JI A COG or other implementation diagram can call methods and access data pro vided by an implementation located elsewhere Each Constellation window displays the contents of one work unit at a time this work unit is known as the current work unit By default new model elements are created in the current work unit A model element always exists in exactly one work unit at a time that work unit is said to be its home base work unit Once a model element is created in a work unit it cannot be moved or copied to another work unit A model element or diagram in a work unit can refer to a model element from another work unit In this case the model element is said to be foreign with respect to the current referring work unit When looking at a diagram depictions of foreign model elements have a small triangu lar green hat as seen in Figure 3 1 Place the cursor on the hat to see a ToolTip indicat ing the work unit in which the depicted model element exists Foreign Model Element lt Cog
36. des extensive online HTML documentation This file is cop ied onto your system when you install Constellation It is located in lt your installation path gt cs 8 0x where x is a version specific letter You can open the file directly with any standard web browser such as Netscape or Microsoft Internet Explorer or by starting Constellation and using the Help menu Contents Available Documentation nennen ii Introduction to UML in Constellation 1 1 1 1 Why Use UML Diagrams in Constellation Applications 1 1 1 2 Overview or UME Dine rans estates a etie hos a paste ed tulere En 1 2 1 2 1 Supported UML Diagrams uet t ete E 1 4 12 2 Component Distance latita 1 4 123 State Machine Diagram Sennur lee 1 5 1 3 KEV TEPS on p 1 5 1 3 1 Dice 1 5 1 3 2 ModelElenents a eee 1 5 1 3 3 Depicti ns ot Model Elements acne 1 6 1 3 4 Work Unire 1 6 1 3 5 Nodi 1 8 1 4 Types of Model Elements Design and Implementation 1 8 1 4 1 Design Model EIGIteDESs enses tetto ttt sii tette a 1 8 1 4 2 Implementation Model Elements see 1 9 2 Development Process tette 2 1 2 Requirements ANY SIS octaua ta quatum aa 2 2 22 Structura Modeling rai 2 3 2 3 behavior Modeling soprar nanna N g TEn 2 5 vi 24 impleret aHOEo socie mucio 2 6 Work Units and Diagrams ata fete ee oo tni eti ae 3 1 3 1
37. e Built in Type nt f Custom Type Repository Mame Type Mame fin Temp Finish Using the Class to Component Wizard Figure 7 4 Defining Bubbles for Operations e RTI Class to Component Wizard Class MyFndge A Welcome Choose Type Implement a Bubble Port for Operation makelce Implement Pin Ports Implement Bubble Ports Fach operation of the original class may be implemented as a port in the component Check the Model Ports Implement as Port check box to create a new port or uncheck it to omit it If vou wish to implement this operation as a bubble method port please enter its properties below mM Implement as Part Polarity Provides Uses Type Repository Mame Method Mame aee Cancel i Finish 7 5 pIDZIA 7 The next screen seen in Figure 7 5 is used to create class attributes and operations for ports in existing components Therefore this screen is only used if you selected an exist ing component at the start of the wizard see Figure 7 2 For example suppose that you have started implementing the components for the Fridge application While doing so you realize that one of the components needs another port You add it and after debug ging want to reflect the additional port in the class model element To do this you invoke the wizard again to synchronize the component and the class The screen in Figure 7 5 shows the new port in the list and allows yo
38. ed If no such component exists a new component will be created to your specifications Repository Mame MyFepository Component Mame MyFridge Cancel Finish If the wizard has enough information to supply default values for all of the remaining prompts the Finish button will be enabled You can click Finish to use the defaults or click Next to proceed through the prompts and supply information 7 3 p1DZIM Z Figure 7 3 7 4 Next the wizard will allow you to create pin data ports for each of the class s attributes and bubbles for each of its operations To skip an attribute or operation clear the Implement check box and click Next See Figures 7 3 and 7 4 for examples Defining Pins for Attributes M RTI Class to Component Wizard Class MyFridge Welcome Choose Type Implement Pin Ports Implement Bubble Ports Model Ports Cancel Implement a Pin Port for Attribute minTemp Fach attribute of the original class may be implemented as a port in the component Check the Implement as Port check box to create a new port or uncheck it to omit it If you wish to implement this attribute as a pin data port please enter its properties below Mote that if you choose to create a data port of a built in type it is not necessary to fill in the repository and component names of a custom type M Implement as Port Polarity Reference r Ports of primitive type must be of Reference polarity Typ
39. el eoutput fridgeTemperature Temperature lt lt output gt gt doorSensor CSTypelnt SHUN HOM E 3 4 3 3 4 4 3 5 Figure 3 5 Buttons for Adding New Diagrams to a Work Unit Saving Work Units To save an open work unit click the Save button in the toolbar or choose Save from the File menu You will also be prompted to save any open work unit with changes when you quit Constellation Destroying Work Units To destroy a work unit right click its folder in the Repository Explorer and choose Destroy from the resulting pop up menu Once you confirm your selection the work unit folder and all files inside will be permanently deleted Working with Class Use Case and Sequence Diagrams Constellation diagrams can be in one of two modes Read only or Edit The background color of the workspace indicates whether a diagram can be edited white or is read only yellow The Read only toggle command is under the Edit menu The basic steps for adding renaming and deleting diagrams is the same regardless of the diagram type class use case or sequence Exception you cannot add an implementation diagram to an existing work unit the implementation must be created when the work unit is created Similarly you cannot delete an implementation diagram from a work unit To create and rename a class use case or sequence diagram 1 Select the appropriate button from the toolbar see Figure 3 5 Use Clas
40. ening Existing Work Units To open an existing work unit select the Repository tab and double click the work unit s mf file Work units with implementation may also be opened by double clicking the implementation file cog atc etc Work Unit Mechanics If you open a work unit that contains references to other work units those other work units will be loaded to the extent necessary to satisfy the references Open work units are presented in two parallel ways in the browser pane on the left and in the workspace on the right When one or more work units are open additional tabs appear at the bottom of the Repository Explorer the Current UML Model tab displays all model elements con tained in the current work unit The Opened UML Models tab is similar but displays model elements from all work units currently loaded For work units with implementa tion a Definition tab will also be displayed on the left The Definition Explorer is described in Section 4 5 in the Constellation User s Manual As seen in Figure 3 3 the diagrams in a work unit are organized by the role they play in the work unit There are buttons on the top that display the diagrams according to these four categories I Implementation implementation diagrams COGs FSMs ATCs DFCs STCs and applications IJ Requirements use case diagrams LJ Structural class diagrams LJ Behavior sequence diagrams If a work unit uses more than one type of diagram buttons fo
41. filtering is often useful when you only want to show the details that are relevant in a given context Work Units Constellation organizes UML models and diagrams into groups called work units A work unit consists of UML model elements and any number of UML diagrams The level of granularity within each work unit is up to you A work unit may contain zero or more diagrams You may have several diagrams of each type in a work unit exception a work unit may contain only one implementation diagram Work units may not contain other work units Diagrams show a subset of the existing model elements in the diagram s work unit and or in other work units A work unit and some sample diagrams are seen in Figure 1 1 Unlike in other tools elements in Constellation work units can refer to elements in other work units increasing their potential for reuse For example imagine that you are mod eling a robotic arm positioning application One work unit might describe the language of the mechanism joints motors and encoders Then you might have another work unit Key Terms Figure 1 1 iti t 11 ThermostatDial TemperatureController lt lt prdvides gt gt setThermostatValuel int Example Diagrams in a Work Unit Open Fridge Close Fridge Use Case Diagram ean Thermostat TemperatureControlld lt lt input gt gt fridgeTemperature Temperature lt lt in
42. gt gt see Green hat indicates this is a Fr depiction of a model element FridgeSimulatian from another work unit If a foreign representation of a model element is inconsistent with the current state of the model element itself the green triangle becomes a red circle as seen in Figure 3 2 For example if you delete a model element from its home work unit any depictions of the model element in diagrams of editable work units will also be removed But if the 1 The implementation diagrams of F5Ms and COGs do not use the foreign work unit indicator All con tained items within implementation diagrams are foreign Physical Structure deleted element appears in a work unit that is in read only mode or is not fully loaded the element is marked with a red circle to show that it is out of sync Figure 3 2 Foreign Model Element with an Error A red circle means the foreign model element is out of date the model element referred to here has been modified or deleted in its home work unit and this work unit is in read only mode and therefore could not be automatically updated Visual Properties Synchronize with model element v Ej Show Operations To resolve the problem use the Edit menu to disable the Read only mode then right click and select synchronize with model element Implement Show Implementation 3 3 Physical Structure Think of a work unit as a document made up of several physical f
43. he people creating the prod uct s requirements and the designers and architects They are typically created before the design or the implementation phase In Constellation requirements are shown by creating use case diagrams described in Chapter 4 LJ Behavior diagrams These diagrams also called interaction diagrams show the interaction between various parts of the system They typically model how one part responds to messages sent by other parts It is common practice to create high level interaction diagrams in the early phases of a project typically derived from use case diagrams During the imple mentation phase new interaction diagrams are created to show the low level interaction that models the expected or implemented dynamic behavior of the system The parts of the model depicted in these diagrams imply certain structural rela tionships For example if two parts are sending messages to each other they must have the right kind of association navigability etc In Constellation behavior diagrams are shown with sequence diagrams described in Chapter 6 LJ Structure diagrams These diagrams capture the structural relationship between various elements in a product s design These elements may include classes interfaces and components The purpose of these diagrams is to communicate the high level design from the designer to the implementors In Constellation these structural relationships are shown by creating class dia
44. her related items Design Model Elements Design model elements include class use case and similar model elements and the rela tionships between them such as associations generalizations and dependencies These elements are typically created prior to entering the implementation phase However it is also possible to create these elements as a result of reverse engineering the implemen tation Types of Model Elements Design and Implementation Figure 1 2 Design vs Implementation Model Elements Fridgellodel lt lt oUtpul gt gt fridgeTemperature Temperature lt lt oUtpul gt gt doorSensor CSTypelnt FridgeSimulation Class a design model element fridgeTemperature doorSenaar thermostat Thermostat setlemperature fridgeModel lois Fricigellode Liser compressori n fr doorOpenClose FridgeSimulation COG an implementation model element Design model elements help you understand the system at an abstract level by hiding many implementation details They can provide a high level understanding of a system But because they do present a 1 000 foot view they also show only a partial truth of the system a lot of details are simply missing from the model As a result such ele ments need to go through a transformation into implementation elements before they can be used in a system 1 4 2 Implementation Model Elements Implementation model elements include COG
45. iation tool and dragging from one to the other 4 3 2 Subdividing a Use Case Now that our basic use case has been created we need to refine it to present a clearer idea of just what the user must do when operating the refrigerator We will do this by breaking down the use case into several use cases of finer granularity with the includes relationship An included use case is one that does not stand independently it must be part of another broader use case Part of operating a refrigerator includes opening and closing the door as well as chang ing its settings 5o we need to create three additional use cases and connect them to the original Operate Fridge use case using dependencies with lt lt includes gt gt stereotypes as seen in Figure 4 9 Figure 4 9 Example with Includes Dependencies i Open Fridge y ri eencludes d Fil Close Fridge Ir Operate Fridge lt includes gt gt in A ti User Change settings To build upon Figure 4 8 to create the diagram in Figure 4 9 1 Double click the use case button in the drawing toolbar to make it sticky 2 Click the diagram workspace three times to create three new use cases in the work unit and place depictions of them in the diagram 3 Click the Select button in the drawing toolbar the dark arrow on the top to unstick the use case tool 4 9 SOSD2 esf p 4 3 3 4 10 p M gw Change the new use cases n
46. iles Although a work unit contains several files it is designed to be worked with as a cohesive entity you will open it save it and check it into and out of configuration management systems atomically Each work unit including the files that belong to it exists in its own directory within a Constellation repository If the work unit contains implementation it must exist in a sub folder appropriate for its type of implementation COG ATC etc Work units without implementation may exist anywhere in a repository For more information on Constellation repositories and their structure see Chapter 5 in the Constellation User s Manual What files are created for a work unit I Each work unit has a manifest file mf that lists the files that comprise it J Each work unit has an XMI file xmi used to store the UML model elements J Each class use case and sequence diagram is stored in an SVG format vector graphics file svg I Implementation diagrams are stored in formats appropriate for their particular type ATCs are stored in atc files COGs are stored in cog files and so on Primitive components additionally have associated C source code files cxx 3 3 SHUN HOM E 3 4 3 4 1 3 4 2 Dependencies between work units are managed by three index files which exist on a per repository basis 1 A model element index model index xml maps each model element s Univer sally Unique Identifier UUID
47. kages You can use nested packages to show greater degrees of similarity between model elements Like other model elements a package can have a name and a stereotype as seen in Figure 4 3 Package Diagram Stereotype Open Fridge Name CUN p i o Close Fridge Comments A comment model element allows you to attach simple documentation to any other model element in a diagram Comments are typically used to describe certain character istics that are not otherwise apparent Select the Comment tool from the drawing toolbar and click near the model element you want to comment Double click the text of the comment and type whatever docu mentation you desire When you are finished typing click outside the text box to com mit your change or press lt Escape gt to revert your change Select the Anchor to Model Elements Comment tool and use it to draw a line between your new comment and the model ele ment to which it refers as seen in Figure 4 4 Figure 4 4 Comment 4 2 5 4 2 5 1 4 2 5 2 enter comments here Open Fridge Relationships Different types of lines are used to visually define relationships between other model elements These relationship lines are also considered model elements The types of relationships you can show between model elements in a use case diagram include I Generalizations Section 4 2 5 2 I Associations Section 4 2 5 1 L Dependencies Section 4 2 5 3 To draw
48. l using a Remote Proce soouenbegs 9 dure Call RPC technology such as CORBA in which case network latency will intro duce a delay between a when a message is sent and when it is received If the message will be received at a time substantially later than when it was sent the message line is typically drawn slanting downwards Note that the tool prevents you from slanting the message line upwards since that would indicate the message travelled backwards in time and was received before being sent Messages are drawn as lines between the lifelines of two classifier roles Each message line has an arrowhead that points toward the receiver of that message If the message s type is set to None the default the arrowhead appears as two connecting lines not a triangle Once the type is specified the arrowhead becomes a hollow triangle Figure 6 4 shows both types of arrowheads Message types are described in Section 6 2 2 1 Figure 6 4 Message Arrowheads in Sequence Diagrams specified message type tN Unspecified message type ke l l l l i i Messages sent by a classifier role to itself double back on themselves to reconnect with the sending role as seen in Figure 6 5 Arrowheads have the same meaning as discussed above Figure 6 5 Message Sent by a Role to Itself 6 2 2 1 Message Types Messages may be of several types corresponding to the various ways in which objects may communicate with one anothe
49. lation FridgeSimulation file C RTIZConstellation 1 d cs 8 dZrepositoriesZrti tutorial coosZFridg Miel E3 Fille Edit amp mangeN View Go Window Toole Help UML gt eRe e ajaja ear uu 20 EE Implementation Requirements Structure Behavior c Basic Access B si Open Fridge 7 Drawing os toolbar for lt lt includes gt selecting Pi the type of m a 3 Pa lt lt includes gt gt GIONG nage element Fa ee you want to TER create see m i E cludes gt gt Figure 4 2 7 MEN l Change settings lt lt exterds gt gt RepairFerson lt lt ncludes gt gt wie m This use case diagram is provided in the rti tutorial repository s FridgeSimulation COG 4 2 Model Elements 4 2 Model Elements Figure 4 2 shows the types of model elements you can include in use case diagrams For general information on how to work with diagrams and model elements see Section 3 5 and Section 3 6 respectively Figure 4 2 Drawing Toolbar for Use Case Diagrams 4 2 1 select Section 3 6 1 Actor Section 4 2 1 Use Case Section 4 2 2 Package Section 4 2 3 Comment Section 4 2 4 Association Section 5 2 4 1 Use these lines to show relationships between model elements Generalization Section 5 2 4 2 Dependency Section 5 2 4 3 Anchor to Comment Section 5 2 3 To insert one of these model elements click the button to se
50. lect then click inside the workspace To insert more than one double click the button then click multiple times in the workspace Actors An actor is any entity human or machine that is outside the scope of your system but that interacts with it in a relevant way It is conventionally depicted as a stick figure In Figure 4 1 a user operating a refrigerator is modelled by an actor and so is the repair person If you were designing a car the driver would likely be an actor If you were designing only the car s transmission the engine might be an actor in one or more use case diagrams 4 3 SOSD2 OSN 7 4 2 2 4 2 3 Figure 4 3 4 2 4 4 4 Use Cases A use case model element describes a scenario in which actors are engaged It is conven tionally depicted as an oval with a name in the center Because use case modelling is done at a very high level when you are deciding what your system needs to do not how it will do it a use case typically does not correspond to any particular piece of exe cutable code that you might produce later nor does its name correspond to any pro grammatic identifier It describes the context in which a system will be used not that system s structure or complex behavior Packages Packages provide a way to group related model elements together A package can con tain use cases actors relationships the lines that connect uses cases and actors see Section 4 2 5 and even other pac
51. ments that make of the collection have no reason to exist by themselves It is com mon to refer to this type of relationship as a has a or containment rela tionship For example the relationship FridgeModel has a Switch will be shown as the FridgeModel class composing a Switch class Composition implies that the composed object Switch will be created and destroyed along with the composing object FridgeModel This type of association end is shown by a solid diamond on the composing end FridgeModel Figure 5 7 Association Ends Arrowheads used for Composibility None Composite lt lt Cog gt gt Thermostat lt lt input gt gt fridge Temperature Temperature lt lt input gt gt doorSensor CSTypelnt lt lt provides gt gt setThermostat setting int void FridgeModel lt output gt gt fridgeTemperature Temperature ThermostatDial lt lt output gt gt doorSensor CSTypelnt lt lt provides gt gt setThermostatValue int 1 Navigability This type of end simply shows that one model element knows about can make references to the model element on the other end The default situation is that the model elements connected by an association have a mutual relationship both ends know about each other and are free to make references to each other This is rendered as a line with no arrowheads on the endpoints the default If you want to restrict the relationship
52. n m To open an existing class use case or sequence diagram I Recall from Section 3 4 2 that diagrams are organized according to their role in the work unit Select one of the four buttons on the top to see its related dia grams as seen in Figure 3 4 For instance to open a work unit s class diagrams select the Structure button to open sequence diagrams select Behavior 3 9 SHUN JOM 3 6 3 6 1 To delete a class use case or sequence diagram 1 Select the Current UML Model tab 2 If the Model folder at the top of the tree is open expanded double click the folder to close collapse it This will make it easier to see the entries in the Dia grams folder in the next step 3 Expand the Diagrams folder to locate the diagram 4 Right click the diagram and select Delete from the pop up menu Working with Model Elements Creating Model Elements To create a model element use the vertical drawing toolbar located to the left of the workspace Figure 3 7 shows the location of this toolbar and other important tabs and buttons in this case for class diagrams The buttons on the drawing toolbar depend on the type of diagram selected and are described in their respective chapters LJ Use Case Diagrams Section 4 2 I Class Diagrams Section 5 2 LJ Sequence Diagrams Section 6 2 L1 Implementation Diagrams Chapter 4 in the Constellation User s Manual The mechanics of using the drawing buttons
53. ntain several class dia grams that share some elements This kind of arrangement allows you to focus on dif ferent parts of the system one class diagram at a time This chapter describes the model elements that can be used in class diagrams Figure 5 1 shows a sample class diagram o suJDJODIQ SSDID S Figure 5 1 Class Diagram Workspace Drawing toolbar for selecting the type of model element you want to create see Figure 5 2 5 2 Add New Tabs for each Class Diagram appear when Structure is selected Class Diagram Hi Constellation fridgeSimulation file C RTI Constellation 1 0d cs 3 0d repositories rti tutorial cogs Fridgesi alils safe e e sll i gt ce _tnplnefiaion Vries Isis i _sehavir_ Overview Temperature Control lt lt Cog gt gt Ern Thermostat lt lt Alc gt gt ThermostatDial inputz fridgeTemperature Temperature lt lt input gt gt doorSensor CSTypelnt lt lt provides gt gt setThermostatValue int lt lt provides gt setThermostat setting int void lt lt gqg gt gt 9uspsTo compressor light Fsm gt gt Saf TemperatureController lt lt CSinterface gt gt E Switch lt lt provides gt gt setMaximumTemperature temp Temperature void on void lt lt provides gt gt setMinimumTemperature temp Temperature void offi void light compressor l
54. o enable just such situations By adding your own documents to a work unit s manifest you ensure that they will be stored with your design and implementation and that they will be checked into and out of version control simultaneously and automatically For more information on work units see Chapter 3 Structural Modeling REQUIREMENT BEHAVIOR SPECIFICATION MODELING IMPLEMENTATION A program s structural design describes what its constituent parts are and how they connect to one another It does not specify what the interactions among those parts are that is the role of a behavioral design Structural and behavioral design together com prise what is frequently called the design phase of a software process Although it is true that some degree of requirements analysis will frequently precede a structural or behavioral design and that some degree of design will likely precede the bulk of the software implementation the development process is often more fluid in practice than the phrase design phase might suggest The above diagram attempts to capture that 2 3 SSODOld Z 2 4 reality more accurately by separating structural and behavioral design and explicitly showing many of the interconnections between development tasks A structural design captured with a software modeling formalism such as UML is fre quently known as a structural model Structural models in UML are typically depicted with class diagrams
55. ociation is drawn as a line with two endpoints called association ends You indicate the nature of the relationship by selecting different properties for the association ends as described in this section As is true with all types of UML model elements an association can have a name and a stereotype and so can each of the association ends To enter names and stereotypes for an association and its end points double click the line to display the Properties window for the association as described in Section 3 6 3 Each association end also has a set of properties that you can modify by right clicking and using the resulting pop up menu For examples see Figure 5 6 and Figure 5 9 suJDJODIQ SSDID S Figure 5 6 Association Ends Specifying Composibility and Navigability 5 6 lt lt Cog gt gt lt lt output gt gt fridgeTen lt lt output gt gt doorSens FridgeSimulation End Mane FridgeModel End se FridgeSimulation Right click the association line to display the pop up menu Visual Properties Synchronize with model element Model Element Properties Delete Model Element Add Stereotype Aggregate Composite Navigable Properties for Association Ends I Composibility An association end can have three kinds of composibility None Aggregate and Composite These types are described below Figure 5 6 shows how to make your selection Each choice is indicated in
56. on However unlike a regular object in a language such as C a classifier role may belong to many types or none at all A classi fier role with no base types is useful when your sequence diagram models interactions at a very high level before the names and identities of classes and interfaces in your implemented system are known Classifier roles appear as rectangles with vertical lines stretching downwards beneath them as seen in Figure 6 3 These vertical lines are called lifelines They represent the passage of time Events occurring later appear beneath events that occurred earlier 6 3 soouenbegs 9 Figure 6 3 Sequence Diagram Terms Classifier roles ThermostatDial Time Messages 6 2 1 1 Names and Base Types The rectangle at the top of a classifier role s presentation is analogous to the top com partment of a class in a class diagram it displays the name and stereotype of the classi fier role Unlike a class a classifier role like an object may represent an instance of one or more base types The name of a classifier role itself and the name s of its base type s are typically both displayed and are separated by a colon such as roleName baseType The names of multiple base types are separated by commas For example I roleName denotes a classifier role with the name roleName having no base type I className denotes a classifier role with no name or whose individual name is
57. one of the several diagram types that Constellation supports A class diagram appears as a directed graph in which the nodes represent types classes and interfaces and the lines show relationships among those types Several kinds of rela tionships are supported including aggregation generalization dependency and so forth For more information about structural model elements and class diagrams see Chapter 5 When many people start modeling the structure of their programs they are unsure of the degree of detail that is appropriate to display in a class diagram When trying to decide whether more or less detail is appropriate always keep in mind the purpose of class diagrams to define the identity and features of types and the relationships between them Attempting to stretch the expressiveness of the medium beyond this purpose tends to result in diagrams that are prohibitively complex and difficult to understand A structural model should capture enough detail to enable the reader to understand the problem and its proposed solution it should not try to specify every implementation detail Behavior Modeling 2 3 Behavior Modeling REQUIREMENT BEHAVIOR SPECIFICATION MODELING IMPLEMENTATION A behavioral design or when captured by a modeling formalism such as UML a behav ioral model specifies the interactions among participants in your system Unlike struc tural models which capture the static relationshi
58. ons The top section shows the class s name and stereotype The middle section shows the attributes of the class The bottom section shows the operations offered by that class 5 3 suJDJODIQ SSDID S Figure 5 3 5 2 2 H Figure 5 4 5 2 3 5 4 Class Model Element Stereotype Icon Stereotype see Section 3 6 5 Name Atribute zudem fridgeTemperature Temperate lt lt input gt gt doorSensor CSTypelnt Operation provides gt gt setThermostat setting int void The last two sections are optional you do not have to show them In fact hiding attributes and operations is usually a good idea when showing classes that are periph eral to the concept being explained If you give a class a stereotype that matches one of Constellation s component types ATC DFC STC COG FSM or APP a matching icon appears in the upper right cor ner as seen in Figure 5 3 You can also use your own predefined stereotypes and their associated icons see Section 3 6 5 Interfaces An interface model element is a common way of grouping operations used by multiple classes In our Fridge example both the Thermostat and the FridgeModel classes use the same set of operations from the Switch interface As seen in Figure 5 4 interfaces are rendered much the same way as classes except that the attribute compartment is not shown by default and it has a default stereotype and icon Interface Diagram Default
59. ps between types behavioral models capture the dynamic communication between instances Behavioral models are displayed graphically in different ways depending on the semantics and constraints of the interaction being modeled Any interaction may be rep resented by a sequence diagram In such a diagram each role in the interaction for example the drive shaft wheels and cruise control in an automotive application appears as a vertical column A line drawn between two columns represents a message being passed messages occurring later in time appear below messages occurring earlier in time See Chapter 6 for more information on sequence diagrams Some interactions have more rigorous semantics however A state machine for instance is one type of behavioral model that specifies not only an order of operations but explicitly shows which operations may occur between which participants and under what circumstances State machines are represented by state machine diagrams which are described in the Constellation User s Manual Constellation supports both sequence and state machine diagrams And because of the additional expressiveness available in state machine diagrams Constellation state machines are in fact executable implementation they can govern the interactions among other components and can form the foundation of a deployable application 2 9 SSODOld Z 2 4 Implementation REQUIREMENT BEHAVIOR SPECIFICATION
60. put gt gt doorSensor CSTypelnt lt lt provides gt gt setMaximumTemperature te lt lt provides gt gt setMinimumTemperature te lt lt provides gt gt setThermostat setting int void lt lt Atc gt gt ThermostatDial lt lt provides gt gt setThermostatV4 lt lt CSinterface gt gt Switch on void off void t compressor lt lt Cog gt gt pia FridgeModel lt lt output gt gt fridgeTemperature Temperature lt lt output gt gt doorSensor CSTypelnt lig Class Diagram T Thin f turnCompressor ffi Entry turnCompressor n resetTimer lt lt provides gt gt setMaximumTemperature temp Temperature void I retum I lt lt provides gt gt sdtminimumTemperature temp tpmperature void lt lt retum gt gt lt lt retum gt gt Sequence Diagram fridgeTemperature doorSensor setTemperature thermostat Thermostat fridgeModel FridgeModei compressor n Off doorOpenClose Implementation Diagram COG doorSensor 0 turnLightOft i doorSensor 1 activateCompressor turnLlight n Reset Alarm NULL startCompressor T Tmax NULL Implementation Diagram FSM Work Unit Elapsed Time gt 10 amp T gt Tmax turnCompressor ffi print larmMessage ome e eC 7 uouonpoJul 1 3 5 1 4
61. r A method call takes place via a call message the return of control at the end of a method call is represented by a return message which Model Elements appears as a dashed line One classifier role instantiates another via a create message and destroys it via a destroy message A classifier role may send messages to itself and may even destroy itself Such self destruction takes place via a terminate message A message s type is set in its Properties window As is true for all model elements you can open a selected message s Properties window by double clicking or by right click ing and selecting Model Element Properties from the pop up menu Setting the Action field in the Properties window to Call method indicates that the mes sage s sender is calling a method provided by the message s receiver The adjacent list box lets you select which method from a list of operations contained by the receiving classifier role s base classifiers soouenbegs 9 6 8 Chapter 7 Connecting Design and Implementation 7 1 In Chapter 2 Development Process you learned about the process oriented concepts at work in Constellation Chapter 3 through Chapter 6 discussed particular diagram types and related features This chapter brings you full circle by showing you how to create and maintain connections between your software design and implementation Classes and Components The class model elements of your system describe the va
62. r each type will appear at the top of the workspace Click the buttons to switch views If no diagrams exist in a work unit such as for a new empty work unit the workspace will be blank and the four buttons will not appear When the Implementation button is selected as seen in Figure 3 3 you will see three tabs at the top of the workspace Diagram View for those implementation types edit able in a diagrammatic view Form View and Documentation These tabs are described in Chapter 4 in the Constellation User s Manual When the Requirements Structure or Behavior button is selected as seen in Figure 3 4 you will see one tab for each diagram of the corresponding type in the work unit For example Figure 3 4 shows two class diagrams called Overview and Tempera ture Control these only appear when the Structure button is selected 3 5 SHUN HOM E Figure 3 3 Displaying Different Types of Diagrams in a Work Unit 3 6 COGs FSMs ATCs DFCs STCs Use Cases Classes Sequences applications Ki Constellation 1 0e Cog FridgeSimulation file C RTI Constellation 1 0e cs 8 0e repositories rti_tuLorial cogs FridgeS imulation F ridgeS imulation mf IOl X File Edit Arange View Go Window Thols Hep UML ff gt elle x e e ee ese 7 o p ca re Exes Implementation Requirements Structure Behavior fa rti_control fa rti_cruiseDemo t3 rti cscourse fa rti_deprecated r
63. r the stereotype name Note stereotypes are case sensitive Then double click the Icon cell and click the browse button to locate a gif file to use as the icon for the stereotype User entries in the table have a green background to indicate they can be changed as seen in Figure 3 11 To edit a user created mapping double click the stereotype name or icon Working with Model Elements Figure 3 11 Mapping Stereotype Icons Stereotype Icon Mapping CMylcons MyBlueSquare gif Only green rows can be changed New icon appears 7 when you use the mapped stereotype 3 15 3 6 6 Deleting Model Elements To delete a model element select the model element from the Current UML Model or Opened UML Models tabs or from a diagram s workspace then right click and select Delete Model Element as seen in Figure 3 12 Note using the Delete key is not the same as Delete Model Element The Delete key is like an eraser it takes the depiction of the model element out of the workspace but does not remove it from the list of defined model elements Figure 3 12 Deleting a Model Element A Current UML Models Sic UseCase Tutorial E H Model 5 4 Use ee 1 0 Inter Model Element Properties H Sked Delete Model Element H E Diagrams Insert Into current Diagram 4 Add Stereotype Current UML Model Repository Opened UML Models 3 7 Viewing Exporte
64. rious entities that exist in the system the APIs they offer and the relationships they have with one another These fea tures make such structural models ideal for design and documentation However to actually implement a class model element in software you need a more expressive lan guage For instance not only do you need to specify that your class has a method called Execute you must also specify who will call it when and in what order You must further specify which other classes your class depends on and the specific methods it will call The components ATCs DFCs STCs COGs FSMs and applications pre sented in Constellation s Diagram and Form Views provide these capabilities When you are ready to create a component that will implement the API for a class model element it is not necessary to start from scratch Constellation offers a wizard interface that can create or update a component based on a class model element Con versely the wizard can also take a preexisting component and create or update a class 7 PIDZIM Z model element to match the component The wizard also sets up hyperlinks between a component and its UML diagram 7 2 Using the Class to Component Wizard 7 2 1 Creating a New Component Your first use of the wizard will likely be when you are creating a component for the first time If you have a class model element that specifies the APIs of the component you want to create right click a
65. s FSMs ATCs DFCs STCs etc Design model elements in a work unit are displayed in the Current UML Model and Opened UML Models tabs the structure of a work unit s implementation model element if any is displayed in the Definition tab Unlike design model elements implementation model elements are directly usable in a system to provide specific services and behav ior These elements are created based on their design counterparts in the initial part of implementation Once a skeleton is created more details are added It is common not to have any design counterpart for some of the details of an implementation l UOHONpPOU Chapter 2 Development Process The process by which software is developed differs from organization to organization and potentially from project to project Nevertheless there are certain tasks or stages of software evolution that must be accounted for in any project of reasonable complexity Some of these tasks include requirements analysis structural design behavioral design and implementation These stages may occur just once in a strict order or they may with increasing likelihood iterate from one to another and back again Constellation is designed to facilitate your development process by recognizing each of these stages and providing specific tools each step of the way It is also designed to be flexible it enforces no particular style of development or order of operations and if a particular stage
66. t lt Cog gt gt SHE lt lt outpul gt fridgeTemperature Temperature lt lt output gt gt doorSensor CSTypelnt 4 This class diagram is provided in the rti tutorial repository s FridgeSimulation COG Model Elements 5 2 Model Elements Figure 5 2 shows the types of model elements you can include in class diagrams Most of these model elements are also allowed in use case diagrams and therefore are described in Chapter 4 The only model elements unique to class diagrams are classes Section 5 2 1 and interfaces Section 5 2 2 Figure 5 2 Drawing Toolbar for Class Diagrams 5 2 1 select Section 3 6 1 Class Section 5 2 1 Interface Section 5 2 2 Package Section 4 2 3 Comment Section 4 2 4 Use these lines to show relationships between model elements A Association Section 5 2 4 1 T Generalization Section 5 2 4 2 Dependency Section 5 2 4 3 Anchor to Comment Section 4 2 4 To insert one of these model elements click the button to select then click inside the workspace To insert more than one double click the button then click multiple times in the workspace For general information on how to work with diagrams and model elements see Section 3 5 and Section 3 6 respectively Classes A class model element denotes a structural element potentially with some implementa tion attached As seen in Figure 5 3 a class is shown as a rectangle that has up to three secti
67. t class The Actor button on the drawing toolbar see Figure 6 2 not only creates a new classi fier role but also a new actor to serve as a base classifier for that role When you use it you will see both new model elements appear in the browser under the Model folder The new classifier role visually indicates that its base is an actor by displaying a very small stick figure to the right of its title box The Actor tool is just a convenience feature you could get the same effect by right clicking the Model folder in the browser selecting Add New Actor and then dragging and dropping that new actor into the sequence diagram Messages A message represents a directed communication between classifier roles Like relation ship model elements such as associations and generalizations a message is drawn as a line Unlike relationship model elements messages do not model physical structure they model behavior However it is important to note that behavior implies structure if an object of one type can send a message to an object of another type the first object typi cally contains some kind of reference to the second In most cases the time it takes to send a message may be considered instantaneous For this reason messages are usually drawn as horizontal lines the sending and receiving ends appear at the same vertical level and hence at the same moment in time However this need not be the case A message may represent a method cal
68. t you expect the classes to be implemented as COGs All ele uouyonpoiul 1 3 3 1 3 4 ments with the same stereotype can then be described together For example you know that all classes with a Cog stereotype have one or more habitats Stereotypes are indicated with two pairs of angle brackets called guillemets such as lt lt stereotype gt gt The FridgeSimulation class in Figure 1 2 shows an example stereotype labeled lt lt Cog gt gt which also shows Constellation s icon for a COG component Depictions of Model Elements A diagram contains visual depictions of one or more model elements Visual informa tion size color etc can differ among depictions of the same model element Con versely non visual information about a model element name presence of certain attributes etc is shared among all diagrams because it is derived from the model ele ment You can drag and drop copies of model elements into diagrams Then you can change how a model element appears in the diagram without affecting the actual model ele ment A model element may be associated with multiple diagrams It is also possible that a diagram may show only a part of the information contained in a model element For example one visual rendering of a class element may show all its operations and attributes but another may show only its attributes and yet another may show neither attributes nor operations Presenting information with such
69. the workspace with a dif ferent type of diamond tip as seen in Figure 5 7 Dependencies plain associations aggregated associations and composed asso ciations form a continuum of increasingly strong claims about the elements they connect e None The default This shows the weakest type of association The model element connected to this type of association end knows about makes ref erences to the element on the other end but that is the extent of their rela tionship For example if a Compressor is associated with a Door in this manner it implies that the Compressor knows about the Door but it does not own the Door and creation or destruction of one does not follow to the other they are independent This type of association end is shown by the lack of Model Elements a diamond at the end In Figure 5 7 we see that the Switch interface knows about the FridgeModel and the ThermostatDial knows about the Thermo Stat but no ownership or containment exists Aggregate This type of end shows that one model element contains another model element For example a Thermostat has a ThermostatDial This type of association end is shown by a hollow diamond on the aggre gation end the end that contains the included elements Composite This type of end shows a strict ownership relationship between two model elements It is a strong type of aggregation In a com posite each model element belongs to a single collection The ele
70. ti_drivers O rti network rti netvvork examples E nti tutorial Diagram View Form view Documentation er c DefaultRate co types E methods fridgeTemperature H E interfaces i doorSensor i atcs setTemperature thermostat H E dios a Thermostat fridgeModel il stes user H B tems FricigeMode zi cogs compressor nOff e 3 FridgeModel 1 459 FridgeSimulation i doorOpenClose S FridgeSimulatic EL FridgeSimulatic H E SimulinkFridgevrar H E Thermostat T gt Repository Opened UML Models Definition Current UML Model Work Unit Mechanics Figure 3 4 Class Diagram Workspace Tabs for each Class Diagram appear when Structure is selected if Constellation fridge Simulation file C RTI Constellation 1 0d cs 8 0d repositories rti tutorial cogs FridgeSimulal io loj xj I lalala s ele ajaja lF le Zale eleje TN Overview Temperature Control lt lt input gt gt fridgeTemperature Temperature lt lt input gt gt doorSensor CSTypelnt lt lt FPsm gt gt L TemperatureController lt CSinterface gt gt Switch lt lt provides gt gt setMaximumTemperature temp Temperature void oni void lt lt provides gt gt setMinimumTemperature temp Temperature void off void light compressor lt lt Cog gt gt FridgeMod
71. tions For those attributes operations and ports that are already associated because of a previous wizard invocation you will have the opportunity to synchronize their names and types Figure 7 9 shows an example Documenting an Existing Component At some point you may have a class diagram in which you need to include a compo nent for which no corresponding class model element exists Reverse engineering a component into a class is actually a special case of synchronizing a class and a compo nent Simply create a new class and immediately invoke the wizard on it Rather than selecting the name and repository for a new component enter the name and repository of your existing component Then proceed as before PIDZIM Z Figure 7 9 Merging Sa RTI Class to Component Wizard Class HyApplianceCOG Welcome Choose Type Merge Attribute and Port Implement Pin Ports Implement Bubble Ports The attribute maxTemp CSMat is implemented by the port maxTemp of type Model Ports BUILTIN CSMat However the attribute and the port may be out of synch with one another Please specify how you would like any conflicts to be resolved Merge Mame Mp change C Change the attribute s name to maxTemp C Change the port s name to maxTemp Merge Type Mp change C Change the attribute s type to CzMat C Change the port s type to CoMat Cancel Finish 7 10 Index Symbols mf file 3 3 A actors 4 3 sequence diagrams
72. ton implementa tion for new features from the structural design The same process described in Chapter 7 that created the component in the first place will also guide you in merging your recent changes 2 SSODOld Z 2 8 Chapter 3 Work Units and Diagrams 3 1 What are Work Units Constellation bundles definitions their support files and related UML content together in groups of files called work units A work unit contains diagrams which contain depic tions of model elements LJ A diagram is a visual depiction of a group of model elements Each type of dia gram helps you visualize a different aspect of your system Some types of dia grams such as COGs encapsulate software implementation A work unit may contain at most a single implementation diagram or it may contain no imple mentation at all LJ A model element describes a single item in your system Different kinds of model elements are used in each type of diagram For instance use case diagrams may contain actors and use cases class diagrams may contain classes interfaces and packages sequence diagrams may contain actors and classifier roles implemen tation diagrams may contain either a COG or an FSM See Section 1 3 for more information on diagrams and model elements 3 SHUN HOM E 3 2 Figure 3 1 3 2 Software Reuse Work units are the fundamental units of software reuse in Constellation To facilitate reuse model elements an
73. u to create a new operation for it in the class model element Figure 7 5 Modeling Ports as Attributes and Operations 7 6 gs RTI Class to Component Wizard Class MyFridge Welcome Choose Type Model Ports as Attributes and Operations Implement Pin Ports 2 MM Mice AE Fither you have elected to create a new component or the component with which you have elected to merge defines no ports that do not already tmplement an attribute or operation in the class Click Nest to continue Model Ports az Attributes and Operations Cancel i Finish Using the Class to Component Wizard The wizard s last screen seen in Figure 7 6 presents a summary and gives you a chance to make any final changes before the component is created or updated When you are ready to proceed click Finish Figure 7 5 Summary Window gs RTI Class to Component Wizard Class MyFndge Welcome Choose Type summary Implement Pin Ports Implement Bubble Ports Model Ports The options you have selected appear below If you have changed your mind about any decision go back or just uncheck the box next to the action you do not wish to take Some actions may be mandatary because others depend on them you will not be able to uncheck those options Create ATC component hiyFridae in repository WyRepository F Move the Class My Fridge to the neve work unit if necessary v Set stereotype of Class MyFridge to Atc M Change the name of the Class M
74. uct will be used and the tasks it must support In addition to its other diagramming tools Constellation also includes a built in editor for use case diagrams Use case diagrams are described in Chapter 4 For many large projects collections of diagrams are not enough the facilities of a pow erful dedicated solution are required One of the most popular requirements manage ment systems is Telelogic DOORS It provides hierarchical distributed storage of large numbers of detailed requirements and extensive connections between them Constella tion offers tight integration with DOORS Each reusable unit of software you produce called a work unit can be associated and synchronized with a DOORS requirements module For more information on using DOORS with Constellation see the online docu mentation use the Help menu to select Online Documentation Structural Modeling 2 2 In some cases such a heavyweight requirements analysis may not be necessary or use ful It may be sufficient to describe the software in a word processing document spread sheet or other external file Or you may use a custom tool developed in house In such cases the connections between your development environment and your requirements capture tool are necessarily looser Nevertheless it is desirable to maintain the software and the external requirements in parallel You can leverage Constellation s work unit infrastructure and version control integration t
75. unimportant with a base type className I role class1 class2 class3 denotes a classifier role named role of base types class1 class2 and class3 By displaying the colon even when the role name or the base type name is not present it makes it easy to determine which of these names a string represents by looking at the relative position of the colon 6 4 Model Elements 6 2 1 2 6 2 2 Adding Classifier Roles Because classifier roles in sequence diagrams often represent instances of classes that are also present in your model you may want to create the class diagrams first You can show the relevant classes and the relationships among them in those diagrams and then use the existing model elements to create classifier roles The easiest way to do this is simply by dragging and dropping a model element from the model browser into a dia gram LJ If the dropped model element is a use case class interface or actor a new classi fier role will be created and displayed in the diagram The new classifier role will have the dropped model element as its base type LJ If the dropped model element is itself a classifier role that role will be displayed in the diagram If you think of classifier roles as analogous to objects then a role s base classifier is the class to which that object belongs When you drag and drop a class into a sequence dia gram you are in effect inserting an instance of tha
76. w tipped arrow pointing from the derived ele ment towards the base element In Figure 4 6 a generalization is drawn from the Repair Person actor towards the User actor Figure 4 6 Generalization 4 6 Generalization Uu er 2 inc Base element B Derived element RepairPerson Dependencies A dependency shows that one model element uses is dependent on another This is a weaker type of relationship than an association Section 4 2 5 1 For example in Figure 4 7 we see that the repair process depends on accessing a log In a dependency model element A uses model element B or relies on B s existence However A may not have explicit knowledge of B s inner workings Model Elements A dependency appears as a dashed line with an arrowhead pointing towards the model element that is depended on as seen in Figure 4 7 where the repair process depends on accessing a log Figure 4 1 shows several more examples of dependencies Figure 4 7 Dependency This dependency has a stereotype that further identifies the relationship lt lt includes gt gt i Access log Dependencies often use stereotypes to show two specific types of dependency relation ships known as extends and includes L Extends An extends relationship indicates that one use case the extending use case con tains additional semantics that augment those of another use case the extended or base use case For example in Figure 4 1 we see that the
77. yFridge to match its implementation M Add pin port min Temp of type int to the component M Set stereotype of Attribute minTemp to Reference M Add pin port maxTemp of type int ta the component v Set stereotype of Attribute maxTemp to Reference Cancel Note To encourage software reuse Constellation dictates that a work unit may contain at most a single component definition Thus when you choose to create a new component from a class the wizard will place that component in a new work unit and move the original class to that work unit 7 7 PJDZIM Z The wizard will create or update the component and create a hyperlink between the component and the class model element as seen in Figures 7 7 and 7 8 Figure 7 7 Class Model Element after Implementation Icon added for the ag component type Green hat added to show that this is now a depiction of a model element from another work unit Visual Properties minTemp int maxTemp defrost cs core IntA makelce Synchronize with model element v Ej Show Attributes Hyperlink to v H Show Operations component Implement Show Implementation Model Element Properties Delete Model Element Add Stereotype Ej Add Mew Attribute Add Mew Operation Figure 7 8 New Component Hyperlink to model element tal Constellation MyFridge file C CSRepositories MyUMLRepository
78. ying multiplicity are described below UR e Any number including zero Use an asterisk to show that you can have any number of class or interface objects associated with that associa tion end e A specific number Enter an exact number of class or interface objects associated with that association end For example you can specify that your refrigerator has two doors by entering 2 for the association end near the Doors class Model Elements e Arange Specify a valid range for the number of objects by entering two numbers separated with for example 2 4 means that you can have either 2 3 or 4 associated objects no more no less Specifying 4 means that you can have four or more associated objects Note that 0 has the same meaning as a single asterisk e Multiple ranges Specify a set of valid ranges by entering a series of comma separated ranges For example 1 3 6 7 specifies that you can have either 1 2 3 6 or 7 associated objects Figure 5 9 Association Ends Specifying Multiplicity lt lt Cog gt gt AM 1 Right click the FridgeSimulation association line to display 3 the pop up menu visual Properties Synchronize with model element lt lt Cog gt gt 2 Select Model Element Properties Model Element Properties Fridge lt lt output gt gt fridgeTen output doorSens amp Add Stereotype FridgeModel End Delete Model Element
79. ypelnt Drawing Toolbar for adding model elements How a drawing tool appears when double clicked sticky for creating multiple elements in the workspace Working with Model Elements Figure 3 8 Editing Model Element Properties FridgeModel Cog lt outnut fridaeTemperature Temperature zanutput doorSensor CSTvnelnt Figure 3 10 Editing Visual Properties Click one of the three buttons to change the fill color text color or font Note that this only changes how the depiction of the model element appears in the current diagram 3 13 3 6 5 3 14 Adding Custom Stereotype Icons If you use a stereotype that matches one of Constellation s component types ATC DFC STC COG FSM or APP a matching icon appears in the upper right corner such as the COG icon seen in Figure 3 9 You can also create a mapping between your own custom stereotype and any icon in gif format that you choose To do so select the Stereotype icons command under the UML menu The UML menu only appears on the toolbar when you have a UML dia gram open Figure 3 11 shows the dialog for adding and removing your own stereotype icon mappings as well as how the icon is used in a model element The icons used for predefined Constellation components cannot be changed or removed they appear in white in the table to indicate they are read only To add a mapping click Add Double click the Name cell to ente

Download Pdf Manuals

image

Related Search

Related Contents

SD Compressor Service Guide  Consulter la fiche technique  Trust Vintori  Spirit S3 - Tosia.pl  Samsung BF1N4T023 Manuel de l'utilisateur  NEC ShieldPRO FC-Note Series User's Manual  Cillichemie Italiana CILLIT NECKAR 58-78-118-168  Compaq AlphaStation XP900  

Copyright © All rights reserved.
Failed to retrieve file