المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Guide to ArgoUML - how to user argoUML -



A7med Baraka
11-12-2008, 08:16 PM
Introduction


This is a very preliminary document developed as we were adding diagrams to the example documents for the Departmental Documentation Standards. As such, this document will be changed whenever we learn how to use ArgoUML in a better way. We have used ArgoUML enough to force it to provide us with a documentation tool. We have become very interested in what will happen when we learn to use it correctly and take advantage of its strengths.

The following section is from Appendix A of University of Scranton Computing Sciences Department Project Documentation Standards, Fall 2001 Edition. The images are screen captures which have been cropped rather than using the Save Graphics feature of ArgoUML.

Getting ArgoUML

Our department has experimented with the Rationale Rose Student Edition and the Object Technology Workbench Private Edition 2.4. Each has proved satisfactory but its owner has subsequently restricted each. While we cannot fault a company for making business decisions that allow it to stay in business, we feel that it is important that we provide access to a UML that is free and can be loaded onto students’ PCs.

We believe that Argo/UML from the University of California will work well. It is a program that is built on top of the Java environment. To run Argo/UML, you need a Java 1.2 virtual machine. This is available for free from Sun Microsystems. Information about how to load one onto your PC is available under Java Resources from the departmental Web site. We have loaded Argo/UML on the departmental lab computers.

To obtain your own copy of Argo/UML, visit
[/URL]http://www.barakasoft.com/vb/showthread.php?t=885 (http://argouml.tigris.org/v08/index.html)
or [url]http://www.barakasoft.com/vb/showthread.php?t=886

The first site allows you to download a compiled version of the program. It is in zipped format. Unzip it to obtain .jar files. The file argouml.jar is the program. Double click on argouml.jar to run the UML. The second site provides documentation on how to use the program.

We will describe Argo/UML’s use here only for documentation. It also can generate some Java code and has a Javadoc tie-in but that we have not yet experimented with those features. The version we have available provides more than sufficient power to use for documentation, which is the purpose of this document.

Some previous students may have a copy of the student copy of Rational Rose or OTW Private Edition. If you still have a copy it can be used but we cannot provide you with copies that we have downloaded, as we do not have permission from the owners.

The information here is for Argo/UML but the concepts apply to all UML’s. The icons may look slightly different using other UML’s. (The examples in this document have been produced using three different versions.) The capabilities and meanings, however, are part of a standard to which all UML’s adhere. This standard, as well as the CORBA standard, is maintained by the Object Management Group (hhtp://www.omg.org)

This section is very brief as we have just started using Argo/UML and we are still learning. The Argo/UML documents referenced above assume knowledge of UML and show how to create diagrams with which you are already familiar. A good starting reference for the UML is Scott (Scott, Kendall. UML Explained. Addison-Wesley, 2001.) as it is very readable. A very complete reference is Jacobson, et al, (Jacobson, Ivar, Grady Booch, and James Rumbaugh. Unified Software Development Process. Addison-Wesley, 1999.) but it is not an easy read as it discusses the UML as part of an exposition on the USDP.
Example Diagrams

System Environment

The system environment (see SRS 2.1) does not fit into the standard diagram description. It can be created with any graphical tool. While the system environment is not a use case, we can use a use case diagram or a class diagram to express it.



http://www.cs.scranton.edu/%7Edmartin/dsuml2_files/image002.jpg



Figure 1 — System Environment (Use Case Diagram)




http://www.cs.scranton.edu/%7Edmartin/dsuml2_files/image004.jpg



Figure 2 — System Environment (Class Diagram)

Use Case Diagram



http://www.cs.scranton.edu/%7Edmartin/dsuml2_files/image006.jpg



Figure 3 — Use Case Diagram

Use cases today are the foundation of clear specifications. A use case diagram involves actors (both user types of the system and cooperating systems) and use cases.
Actors

One of the most important icons that the UML provides is the actor. An actor, represented by a stick figure, is a class of user or an external system with which your system interfaces such as Administrator above. Each actor has a name that uniquely identifies it.

In the diagram centric view, create a use case diagram. The actor icon can be selected and placed on the screen (enlarge the work screen when creating a use case). Click where the actor should be placed. Provide the actor with its name. Click in the work area to add other actors as needed. (Double clicking the actor icon allows several actors to be placed at once.) Move the icons around as needed.
Use Cases

A use case is an oval with a name. Select and place use cases as above.
Relationships

Relationships are arrows that show which actor(s) is involved with which use case(s). Pull down on the handles attached to the actor or use case. Relationships are usually Associations but a use case can be a Generalization of another use case.

Note that almost never will your first diagram be the one that you will eventually use. If you save your diagrams in the UML, you can reload them and edit them easily in the future. Use Remove from Diagram from Edit menu to delete an element.

The overview of all use cases is a useful diagram to start with. For example:



http://www.cs.scranton.edu/%7Edmartin/dsuml2_files/image008.jpg



Figure 4 — Overview of Use Cases


Class Diagram

Classes



http://www.cs.scranton.edu/%7Edmartin/dsuml2_files/image010.jpg



Figure 5 — Class Icon

A very important icon that the UML provides is the Class. It can have
An identifying name (FileMgr)
A prototype <<code Module>>
An attributes area (middle) and
An operations area (bottom).



Actor icons can be copied (Ctrl-C for copy and Ctrl-V for paste) from the Use Case Diagrams.
The name of a class can be added as for actors and use cases.
Right clicking the class and selecting Add Attribute adds an attribute. An attribute has a name and a type and perhaps a default value.
An operation can be added similarly. An operation has a name as well as a signature (parameter types). Right click and select Property and then use the Property tab in the bottom right screen to fill in a prototype. Double click attributes or operations to edit them.
The attribute box and/or the operation box can be removed.


Add relationships between classes that communicate with each other.

For a design diagram, fill in only the most important attributes and operations of each class.

That is all that is in the original document. We continue the development of ArgoUML using the Save Graphics feature to capture the images.

State Transition Diagram

A useful tool for expressing a complicated sequence of events in a full description of a use case is the state transition diagram. These are easy to construct and modify in ArgoUML. The only complication is that each state diagram must be attached to a class. We can set up a state diagram whose only purpose is to have states representing use cases to which we attach state diagrams. Then we use the Create/Diagrams/State Diagrams on the menu bar to produce a diagram such as the following:
http://www.cs.scranton.edu/%7Edmartin/dsuml2_files/image011.gif


Figure 6 — State Transition Diagram


We note that a single black dot is the start state, a black dot in a circle is an end state and we can package coherent large parts of the diagram in compound states.

Deployment Diagram

An example of a deployment diagram (used in the Software Design Document) is

http://www.cs.scranton.edu/%7Edmartin/dsuml2_files/image012.gif


Figure 7 — Deployment Diagram

How to Use ArgoUML

Start the program. You will see a screen with a menu bar on top and four window panes below. The menu bar has a combination of familiar and application specific menus.


The File menu has New, Open, Save, Print, Exit and Save Graphics, (used to save a diagram to transfer to a document).
The Edit menu has an important Remove from Diagram choice.
The View menu has a Find choice.
The Create menu allows you to create a new diagram of any type.
Arrange, Generation, Critique and Help round out the list.

You name a project using the Save As choice on the File menu. It is useful to have already created a directory for the project as ArgoUML likes to use the directory name as the project name.

The four panes on the screen are


The Navigation pane (upper left) lists all items already created, including diagrams, actors, classes, etc. It has several perspectives.
The Editing pane (upper right) is where you build diagrams.
The To Do pane (lower left) lists what still needs to be done for the diagram (this is a powerful tool support feature).
The Details pane (lower right) provides details for the item under consideration, such as diagram titles for the navigation pane or properties for items in a diagram.


Single clicking on an item in the navigation pane allows you to name it in the detail pane (under properties). Double clicking on a diagram in the navigation pane brings it into the editing pane.

Actors are created in a use case diagram. Create and place all actors. Click the Actor icon to create and place an actor. (Double click to create several. Click the Selection arrow to stop.) Type the Actor’s name (role).

Actors can then be added to other diagrams. Right click on the icon in the navigation pane and choose Add to Diagram to add to a use case diagram. Open a use case and use copy (Ctrl-C) and paste (Ctrl-V) to move to a state diagram. Place on diagram by clicking where you want the Actor.

The use case diagram can be used to create the system environment diagram by creating and naming all the actors and using drawing tools (lines and text boxes) to create the other items. The use case diagram can be used to create an overview diagram by selecting the actors and using drawing tools (rounded rectangles, lines, and text boxes) to create the use case categories.

Add use case ovals. Name each use case. You can select a grouping and copy from one use case diagram to another to move actors. Be sure that you create new use cases rather than reusing old ones. If you reuse one, it will loose its original name.

Click on an actor and move the mouse over the side of the icon. An association icon will appear (or choose association from the icon menu at top). Place associations. Clicking on an Actor with an association will adjust the display.