HOW TO DRAW UML DIAGRAMS What is UML? UML stands for Unified Modeling Language. This object-oriented system of notation has evolved from the work of Grady Booch, James Rumbaugh, Ivar Jacobson, and the Rational Software Corporation. These renowned computer scientists fused their respective technologies into a single, standardized model. Today, UML is accepted by the Object Management Group (OMG) as the standard for modeling object oriented programs. Types of UML Diagrams UML defines nine types of diagrams: class (package), object, use case, sequence, collaboration, statechart, activity, component, and deployment.

Class Diagrams Class diagrams are the backbone of almost every object oriented method, including UML. They describe the static structure of a system.

Package Diagrams Package diagrams are a subset of class diagrams, but developers sometimes treat them as a separate technique. Package diagrams organize elements of a system into related groups to minimize dependencies between packages.

Object Diagrams Object diagrams describe the static structure of a system at a particular time. They can be used to test class diagrams for accuracy.

Use Case Diagrams Use case diagrams model the functionality of system using actors and use cases.

Sequence Diagrams Sequence diagrams describe interactions among classes in terms of an exchange of messages over time.

Collaboration Diagrams Collaboration diagrams represent interactions between objects as a series of sequenced messages. Collaboration diagrams describe both the static structure and the dynamic behavior of a system.

Statechart Diagrams Statechart diagrams describe the dynamic behavior of a system in response to external stimuli. Statechart diagrams are especially useful in modeling reactive objects whose states are triggered by specific events.

Activity Diagrams Activity diagrams illustrate the dynamic nature of a system by modeling the flow of control from activity to activity. An activity represents an operation on some class in the system that results in a change in the state of the system. Typically, activity diagrams are used to model workflow or business processes and internal operation.

Component Diagrams Component diagrams describe the organization of physical software components, including source code, run-time (binary) code, and executables.

Protected visibility allows child classes to access information they inherited from a parent class. Associations represent the relationships between classes.Deployment Diagrams Deployment diagrams depict the physical resources in a system. Learn how to edit text. Illustrate active classes with a thicker border. components. and capitalized). and write operations into the third. Active Class Active classes initiate and control the flow of activity. Basic Class Diagram Symbols and Notations Classes represent an abstraction of entities with common characteristics. and connections. They describe the static structure of a system. bolded. Classes Illustrate classes with rectangles divided into compartments. including nodes. list the attributes in the second partition. Learn how to create this symbol. . while passive classes store data and serve other classes. SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) What is a UML Class Diagram? Class diagrams are the backbone of almost every objectoriented method including UML. Private visibility hides information from anything outside the class partition. Public visibility allows all other classes to view the marked information. Visibility Use visibility markers to signify who can access the information contained within a class. Place the name of the class in the first partition (centered.

but each employee works for one company only. Place roles near the end of an association. These symbols indicate the number of instances of one class linked to one instance of the other class.Associations Associations represent static relationships between classes. Use a filled arrow to indicate the direction of the relationship. For example. one company will have one or more employees. Note:It's uncommon to name both the association and the class roles. Constraint Place constraints inside curly braces {}. Simple Constraint . on. Roles represent the way the two classes see each other. or below the association line. Multiplicity (Cardinality) Place multiplicity notations near the ends of an association. Place association names above. Learn how to connect two classes.

and Class B. the difference between inheritance and aggregation can be confusing. It refers to a relationship between two classes where one class is a specialized version of another.Complex Constraint Composition and Aggregation Composition is a special type of aggregation that denotes a strong ownership between Class A. the whole. If you have an aggregation relationship. Learn how to draw a generalization relationship. Honda is a type of car. On the other hand. Use a hollow diamond to represent a simple aggregation relationship. So the class Honda would have a generalization relationship with the class car. but the two classes are not dependent on each other. Illustrate composition with a filled diamond. its part. inheritance allows the inheriting class to access both the PUBLIC and PROTECTED functions of the superclass. Generalization Generalization is another name for inheritance or an "is a" relationship. For example. SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) What is a UML Package Diagram? Package diagrams organize the elements of a system into related groups to minimize dependencies among them Basic Package Diagram Symbols and Notations . the aggregate (the whole) can access only the PUBLIC functions of the part class. in which the "whole" class plays a more important role than the "part" class. The diamond end in both a composition and aggregation relationship points toward the "whole" class or the aggregate. In real life coding examples.

Learn how to draw dependencies and add arrows to your diagram. Public visibility allows an attribute or an operation to be viewed by other packages. Learn how to resize a grouped object like a package. Visibility Visibility markers signify who can access the information contained within a package. . Just as an object is an instance of a class. an object diagram could be viewed as an instance of a class diagram. Dependency Dependency defines a relationship in which changes to one package will affect another package. Importing is a type of dependency that grants one package access to the contents of another package. Private visibility means that the attribute or the operation is not accessible to anything outside the package. Learn how to edit text on a symbol.Packages Use a tabbed folder to illustrate packages. Protected visibility makes an attribute or operation visible to packages that inherit it only. Similar to classes. What is a UML Object Diagram? Object diagrams are also closely linked to class diagrams. you can also list the attributes of a package. Write the name of the package on the tab or inside the folder. Object diagrams describe the static structure of a system at a particular time and they are used to test the accuracy of class diagrams.

which contains the name of the object and its class underlined and separated by a colon. unlike classes. object attributes must have values assigned to them. Object attributes As with classes. Multiplicity You can illustrate multiple objects as one symbol if the attributes of the individual objects are not important. Active object Objects that control action flow are called active objects. Illustrate these objects with a thicker border. However. You can draw a link using the lines used in class diagrams.Basic Object Diagram Symbols and Notations Object names Each object is represented as a rectangle. Links Links are instances of associations. you can list object attributes in a separate compartment. . Learn how to edit text on a symbol. Learn how to connect objects.

Self-linked Objects that fulfill more than one role can be self-linked. Basic Use Case Diagram Symbols and Notations System Draw your system's boundries using a rectangle that contains use cases. When one system is the actor of another system. For example. . if Mark. SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) What is a UML Use Case Diagram? Use case diagrams model the functionality of a system using actors and use cases. an administrative assistant. and the two positions are linked. Place actors outside the system's boundries. Actors Actors are the users of a system. also fulfilled the role of a marketing assistant. Mark's instance of the two classes will be self-linked. Use Case Draw use cases using ovals. label the actor system with the actor stereotype. Label with ovals with verbs that represent the system's functions. Use cases are services or functions provided by the system to its users.

Use the UML object symbol to illustrate class roles. For relationships among use cases. Activation Activation boxes represent the time an object needs to complete a task. use arrows labeled either "uses" or "extends. but don't list object attributes. Basic Sequence Diagram Symbols and Notations Class roles Class roles describe the way an object will behave in context." A "uses" relationship indicates that one use case is needed by another in order to perform a task. . Learn how to edit text on a symbol. An "extends" relationship indicates alternative options under a certain use case. Learn how to draw relationships. What is a UML Sequence Diagram? Sequence diagrams describe interactions among classes in terms of an exchange of messages over time.Relationships Illustrate relationships between an actor and a use case with a simple line.

Various message types for Sequence and Collaboration diagrams Lifelines Lifelines are vertical dashed lines that indicate the object's presence over time. Learn how to attach activation boxes to lifelines.Messages Messages are arrows that represent communication between objects. Asynchronous messages are sent from an object that will not wait for a response from the receiver before continuing its tasks. . Use half-arrowed lines to represent asynchronous messages. Learn how to draw messages.

sequence. Use the UML object symbol to illustrate class roles. Learn how to arra SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) What is a UML Collaboration Diagram? A collaboration diagram describes interactions among objects in terms of sequenced messages. Place the condition for exiting the loop at the bottom left corner in square brackets [ ]. Collaboration diagrams represent a combination of information taken from class. Basic Collaboration Diagram Symbols and Notations Class roles Class roles describe how objects behave. but don't list object attributes.Destroying Objects Objects can be terminated early using an arrow labeled "< < destroy > >" that points to an X. and use case diagrams describing both the static structure and dynamic behavior of a system. Association roles Association roles describe how an association will behave given a particular situation. You can draw association roles using simple . Loops A repetition or loop within a sequence diagram is depicted as a rectangle.

What is a UML Statechart Diagram? A statechart diagram shows the behavior of classes in response to external stimuli. Transition A solid arrow represents the path between different states of an object. Label the transition with the event that triggered it and the action that results from it. You can easily illustrate a state in SmartDraw by using a rectangle with rounded corners.2. Sequence numbering can become nested using the Dewey decimal system. Learn how to rotate objects. Learn how to draw associations. 1. Initial State A filled circle followed by an arrow represents the object's initial state. Messages Unlike sequence diagrams. For example. Learn how to add arrows to your lines. collaboration diagrams do not have an explicit way to denote time and instead number messages in order of execution. This diagram models the dynamic flow of control from state to state within a system. .lines labeled with stereotypes. nested messages under the first message are labeled 1. and so on. Learn how to draw lines and arrows in SmartDraw. 1.1. The a condition for a message is usually placed in square brackets immediately following the sequence number.3. Basic Statechart Diagram Symbols and Notations States States represent situations during the life of an object. Use a * after the sequence number to indicate a loop.

Typically. Because an activity diagram is a special kind of statechart diagram. A short heavy bar with two transitions leaving it represents a splitting of control that creates multiple states. Synchronization and Splitting of Control A short heavy bar with two transitions entering it represents a synchronization of control. . Action Flow Action flow arrows illustrate the relationships among action states.Final State An arrow pointing to a filled circle nested inside another circle represents the object's final state. Basic Activity Diagram Symbols and Notations Action states Action states represent the noninterruptible actions of objects. You can draw an action state in SmartDraw using a rectangle with rounded corners. Learn how to draw action flows. What is a UML Activity Diagram? An activity diagram illustrates the dynamic nature of a system by modeling the flow of control from activity to activity. An activity represents an operation on some class in the system that results in a change in the state of the system. it uses some of the same modeling conventions. activity diagrams are used to model workflow or business processes and internal operation.

You can also label one of the paths "else.Object Flow Object flow refers to the creation and modification of objects by activities. An object flow arrow from an object to an action indicates that the action state uses the object. Final State An arrow pointing to a filled circle nested inside another circle represents the final action state. Learn how to draw object flows. Initial State A filled circle followed by an arrow represents the initial action state." . Branching A diamond represents a decision with alternate paths. An object flow arrow from an action to an object means that the action creates or influences the object. The outgoing alternates should be labeled with a condition or guard expression.

Synchronization A synchronization bar helps illustrate parallel transitions. Learn how to resize grouped objects like components. SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) What is a UML Component Diagram? A component diagram describes the organization of the physical components in a system. It is represented as a rectangle with tabs. Read this this flowchart tutorial to learn how to create swimlanes in SmartDraw. Basic Component Diagram Symbols and Notations Component A component is a physical building block of the system. Synchronization is also called forking and joining. . Swimlanes Swimlanes group related activities into one column.

Learn about line styles in SmartDraw. Dependencies Draw dependencies among components using dashed arrows. components. Basic Deployment Diagram Symbols and Notations Node A node is a physical resource that executes code components. Learn how to resize grouped objects like nodes. Association Association refers to a physical connection between nodes. such as Ethernet. and connections.Interface An interface describes a group of operations used or created by components. . What is a UML Deployment Diagram? Deployment diagrams depict the physical resources in a system including nodes. Components and Nodes Place components inside the node that deploys them. Learn how to connect two nodes.

under UML. you can add a symbol to your drawing by dragging it to the page. . Locating the Symbols and Templates All the common symbols for UML diagrams are located in the Software Design folder. Adding Components to Your Diagram After opening a library. To open a library double click on it or drag it to the drawing area.SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) How to Draw a UML Diagram with SmartDraw SmartDraw is designed to help you create UML diagrams quickly and easily.

Now your cursor looks like a pencil. Drag the pencil to the edge of the other shape until you see the anchor symbol. Choose the line tool you want by clicking on it once. When you see the anchor symbol. Touch the pencil to the edge of one shape and click down with the mouse (you'll see black dots on the edge of the shape). To use a line from a library. You can also draw a line using the toolbar. go to the Arrange menu and adjust your settings to Allow Lines to Link as shown below. .SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) Connecting Lines to Shapes Most software diagrams involve connecting one or more shapes to each other using lines. grab one of its ends and stretch it towards an object. To make sure your lines can connect to shapes. drag it to the drawing area. then release. you can let go of the line and it will attach to the object.

visit this page in the network design tutorial. SmartDraw offers a variety of line tools to draw links and associations Adjusting Line Style To adjust a line's style. or select a different color from the Color palette.Connecting two packages with a segmented line To learn more about the various line options in SmartDraw. then go to the Lines menu and choose a thickness or a dashed line under Style. Adjust a line's style . select the line.

Choose the appropriate arrowhead for the type of relationship you want to illustrate. .Change a line's color Adding Arrows To convert a regular line to an arrow. lines and shapes stay connected. select the line. Connected Shapes Once connected. even if they are moved or stretched. and choose More Styles under Arrowheads. go to Arrowheads under the Lines menu.

To make sure that the shape retains its own angle of rotation. the shape rotates 90 degrees when it attaches to a line. and the connection point appears as a black dot. Attaching an activation box to a lifeline Sometimes. SmartDraw shapes link to lines via a special attachment point located by default in the center of the shape. First. You will also need to know how to drop shapes on a line for other software diagrams.To detach a line from an object it is linked to. then pull the end knob away from the object. the cursor changes to an anchor. right click on the line and choose Horizontally under Align Shapes and Text on a Line. activation boxes are linked to vertical lifelines. As the shape's attachment point comes in contact with the line. Dropping Shapes on a Line In UML sequence diagrams. click on the line. make sure that Allow Shapes to Link to Lines is checked under the Arrange menu. Drag the shape over the line so its center (or attachment point) is near the line. .

SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) Generalization Relationship Generalization or inheritance relationships can be created in SmartDraw using automatic connectors and a triangle.To break the link between a shape and a line. Most libraries already have a symbol you can simply drag out and use.. but you can also create this symbol using the triangle symbol and automatic connector on the toolbar. Drag the generalization symbol from a library or. just drag the shape away from the line.. .

the outline of the moving object jumps to the closest link point. select it again.. .. Attaching Shapes to an Automatic Connector Once the generalization symbol is connected to the supertype box. If you don't see the connection points. As shapes get close to the connector. drag subtype boxes to the automatic connector to attach them. go the Arrange menu and check your settings. the symbol will attach.. Releasing the mouse attaches the object to the connector at the selected link point. showing where it would connect if you released it. As the tip of the triangle touches the box. and move it toward the supertype box you want to attach it to.add a triangle and an automatic connector using the toolbar Using the Generalization Symbol Once you've dropped the symbol on the page. signaling that if released. you should see connection points around the edges of the box. For two shapes to connect. you should have the Allow Shapes to Link setting checked. The connector is a special line tool that automatically connects several shapes in evenly spaced patterns.

. your text will appear inside. To edit this text. or above the shape. Some shapes will already have text on them.Drag the first subtype box to the automatic connector Drag the second subtype to the automatic connector The complete generalization relationship To learn more about automatic connectors. For a line. select it and start typing. double-click on the area you want to edit. SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) Adding and Editing Text To add text to a shape or a line. You can change font size. your text will appear centered on the line. Depending on the particular shape. below. read the organizational chart tutorial.

Choose the appropriate number of rows and columns from the dialog box that appears. To convert a rectangle. then go to the Table menu and choose Convert to Table. select it. You can use the symbols in the UML libraries. or you can draw your own by converting a rectangle shape into a table. color. . alignment in the Text menu and on the toolbar. Change text alignment in the Text menu Use the buttons on the toolbar for quick and easy editing Converting a Shape into a Table UML objects that specify operations and attributes are depicted as rectangles with rows.font type.

you can use the standard Table menu commands to change a cell's background color as well as the grid line thickness and color. some grouped objects will be distorted when shrunk. You can also Join and Split cells to further customize your shape. Due to restrictions on text shrinking. To enter text into a cell. These SmartDraw objects grow and shrink together as if they were one shape. go to the Shapes menu.Once your shape is converted. select the shape. and select Text Entry Properties. double-click on it and type. The converted shape Resizing Grouped Objects Many of the symbols in the software libraries are grouped SmartDraw objects. To change the restrictions on text shrinking. .

Check the box under Allow Text to Shrink and specify a small size such as "8". If you want even more freedom in editing these symbols. you can ungroup them in the Arrange menu. you should be able to shrink your object without distortion. . Now.

and grow the elements of a symbol separately and reassemble them to your liking.Ungroup a UML symbol for better editing Once ungrouped. select the objects you want to arrange. . to align a number of class objects to each other. Do this by clicking on each object in turn (while holding down the shift key). you can stretch. SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) Arranging Objects You can arrange objects on your page by selecting them and moving them with the mouse. For example. shrink. The Arrange menu provides a variety of helpful commands that help you position your objects better. first. For finer adjustments you can use the arrow keys to nudge the object or objects into place.

Applying the Align Left command to the selected classes The results after using both Align Left and Make Same Size Arranging Objects Vertically Although SmartDraw doesn't support layers. When you use the Align or Make Same Size commands.The last object you click has black selection handles and is called the Target Object. you can think of . all the selected objects will be aligned or sized to match the target object.

If a recently drawn object like a loop on a sequence diagram covers parts of your drawing.the objects in your drawing as a vertical stack of blocks. you can go to the Shapes menu and select the transparent fill from the Fill Colors option or you can go to the Arrange menu and choose Send to Back to change the order of the stack. Objects drawn earlier are on the bottom of the stack while objects drawn later are at the top of the stack. The object drawn last is the shape that's on top. The loop shape obstructs the rest of the sequence diagram .

.go to the Arrange menu and choose Send to Back.. go to the Shapes menu and choose the Transparent filter for the loop shape or..To reveal the hidden parts of the drawing.. ..

there might be cases where you will need objects to be at an angle.The sequence diagram once the loop has been sent to the bottom of the drawing stack Rotating Objects Although most software diagrams have a horizontal layout. and using the Rotate/Set Angle command. . release the mouse to see the rotated object. and rotate. specify the exact angle of rotation within one tenth of a degree. go to the Arrange menu. To rotate an object manually. When finished rotating. Most objects have a rotating handle near their right edge. click down with the mouse. select the object. When on object is too small to have a rotator handle or you want to rotate it more precisely. move your cursor over the handle until it changes into a circular arrow.

automatic connectors. However. To rotate a hooked element. and bit maps. curves. first unhook it and reattach it only after it's been rotated. such as the inital and final state symbols. Rotation angles are calculated clockwise from the horizontal. and even most imported items.You can rotate straight lines. SmartDraw UML Center HOW TO DRAW UML DIAGRAMS (cont'd) Tips for Effective UML Diagrams 1) The level of abstraction in your diagrams should meet . Use the diagram below to estimate the correct angle of rotation. Objects also don't rotate when linked. any shape. you cannot rotate segmented lines.

High level management might only be interested in the big picture while developers need as much detail as possible. use a "bridge" (also known as a "line hop") to show that the lines do not intersect. If two lines must cross. so the viewer can drill . SmartDraw allows you to link multiple diagrams.the needs and interest of your audience. Using colors can help you highlight important features in your diagram 4) Address primary structure and behaviour first and model complexities and detail in a separate diagram. 2) Avoid crossing lines by arranging all the elements of a diagram on the page before drawing in the relationship lines. Incorrect line crossing Correct crossover 3) Use notes or color to draw attention to important features.

select the object and choose Hyperlink to Another File from the Tools menu. and your changes will be updated in the other program automatically. • • • Export as GIF or JPEG for the web Export as HTML with working hyperlinks Copy & Paste into PowerPoint or other Office Suite programs When you paste your diagram into another program (such as PowerPoint). 6) Create a polished diagram by adding shadows and color.down into your diagram for more detail. and clicking on it opens the linked file. This opens the diagram in SmartDraw for editing. A small plus sign will appear in the object. 5) SmartDraw makes it easy to share your software design diagram with others in a business presentation or on the web. You can choose from a number of ready-made styles in the Edit menu under Colors and Shadows. or you can create your own. you can edit it by simply double-clicking on the diagram in the other program. To link an object in your chart to another diagram. .

. go to the Arrange menu and select Hide Shadow.A state diagram created using the Sea Green style in SmartDraw To hide the shadow on an individual object.

Sign up to vote on this title
UsefulNot useful