Tutorial ArgoUML
Tutorial ArgoUML
Today we will have a quick introduction to ArgoUML and how to use it, as well as look at some
examples of class diagrams.
Quiz dates:
Quiz 1, available from 9am Friday 13 Mar to 11:30pm Monday 16 Mar.
Quiz 2, available from 9am Friday 3 Apr to 11:30pm Monday 6 Apr
Quiz 3, available from 9am Friday 8 May to 11:30pm Monday 11 May
Quiz 4, available from 9am Friday 29 May to 11:30pm Tuesday2 Jun. Note: Monday 1 June is
the Queen's Birthday holiday.
Review
Last week we looked at how to use Eclipse and an introduction to using Java. Try answering the
following question about the Java main() method.
Q1: What do each of the keywords of the following method signature mean?
public static void main(String[] args) { … }
static This member belongs to the class and not the instance
(object). It means that only one instance of a static field
exists even if you create a million instances of the class or you
don't create any. It will be shared by all instances.
CS230 Sem 1 2015: Please submit all questions and corrections to your tutor.
Page 1
CS230 Sem 1 2015: Please submit all questions and corrections to your tutor.
Page 2
Part A – Installing & using ArgoUML
ArgoUML is a diagramming tool designed for creating and modifying UML diagrams. Its use is
required by your first assignment in CS230.
Step 1: Go to http://argouml-downloads.tigris.org/argouml-0.34/
Step 2: Download ArgoUML-0.34.zip - Binary distribution (.zip format).
Step 3: Save it somewhere on your H:\ drive (or, alternatively your home computer or USB
memory drive)
Step 4: Unzip the .zip file.
Step 5: Inside the extracted directory, open argouml.jar
o ArgoUML should now launch
Step 6: Download umlexamples.zargo from the course assignment page and save it as above
Step 7: (In ArgoUML) use File > Open Project to open the above .zargo file.
CS230 Sem 1 2015: Please submit all questions and corrections to your tutor.
Page 3
Aggregation implies a relationship where the child can exist independently of the
parent. Example: Class (parent) and Student (child). Delete the Class and the Students
still exist.
Composition implies a relationship where the child cannot exist independent of the
parent. Example: House (parent) and Room (child). Rooms don't exist separate to a
House.
The above two are forms of containment (hence the parent-child relationships).
Dependency s a weaker form of relationship and in code terms indicates that a class
uses another by parameter or return type.
Dependency is a form of association.
Task 1:
Now that you have ArgoUML installed and a brief overview of its features, you now have the
opportunity to practice. Use the above tools to draw the following Class Diagram.
Outline:
A local pet store has contracted you to design a system to keep track of their stock, orders and
customers. Before you start work on any code, they want to see what your design looks like. Draw a
simple UML Class Diagram that conveys the following basic concepts.
An “Order” class to keep track of each order a customer makes. It needs to have (at
minimum) the properties of “date”, “price”, “customer”, and “animals” that were sold.
CS230 Sem 1 2015: Please submit all questions and corrections to your tutor.
Page 4
An “Item” class that has a properties “type”, “price” and “quantity” for items like Toys,
birdcages and fishtanks.
An “Animal” class that extends (or generalises) “Item”, to keep track of each animal in their
stock. An animal needs the further properties of “breed” and “isFed”. It also needs the
member (operation) of “Feed()”
A “Customer” class to keep track of each customer, with the properties “name” and
“address”.
Think about the types the following variables would need to have if they were implemented as a
class. The following are some type suggestions: float, boolean, String, Date.
CS230 Sem 1 2015: Please submit all questions and corrections to your tutor.
Page 5
Solution:
CS230 Sem 1 2015: Please submit all questions and corrections to your tutor.
Page 6
Part C – Use-Case Diagrams
Step 1: using ArgoUML go to Create > New Use Case Diagram
Task 2:
For the example described above in part B, draw a use-case diagram to represent the following cases:
CS230 Sem 1 2015: Please submit all questions and corrections to your tutor.
Page 7
Solution:
CS230 Sem 1 2015: Please submit all questions and corrections to your tutor.
Page 8