All notes
Uml

# Basics

SparxSystem.
There are two major groupings of UML diagrams:

• Structural Diagrams which depict the structural elements composing a system or function, reflecting the static relationships of a structure, or run-time architectures.
E.g. Class Diagrams, Composite Structure Diagrams (reflects the internal collaboration of Classes, Interfaces or Components to describe a functionality), Component Diagrams, Deployment Diagrams, Object Diagrams, Package Diagrams, Profile Diagrams, etc.
• Behavioral Diagrams which show a dynamic view of the model, depicting the behavioral features of a system or business process. E.g. Activity Diagrams, Use Case Diagrams, State Machine Diagrams, Timing Diagrams, Sequence Diagrams, Communication Diagrams, Interaction Overview Diagrams.

The most useful, standard UML diagrams are: use case diagram, class diagram, sequence diagram, statechart diagram, activity diagram, component diagram, and deployment diagram.

## Diagrams

### Use case

A use case diagram summarizes who uses your application or system, and what they can do with it. It can discuss and communicate:

• The scenarios in which your system or application interacts with people, organizations, or external systems.
• The goals that it helps those actors achieve.
• The scope of your system.

A use case diagram does not show the detail of the use cases: it only summarizes some of the relationships between use cases, actors, and systems. In particular, the diagram does not show the order in which steps are performed to achieve the goals of each use case. You can describe those details in other diagrams and documents, and link them to each use case.

A use case represents:

• A goal of an actor in using the system, such as {Buy a Meal}; and
• One or more scenarios, that is, sequences of steps performed in pursuing the goal, such as: {Order Meal, Pay, Deliver}. In addition to success scenarios, there might be several exception or failure scenarios, such as {Credit Card Rejected}.

The descriptions you provide for use cases will use several terms related to the domain in which the system works, such as Sale, Menu, Customer, and so on. It is important to define these terms and their relationships clearly, and you can do that with the help of a UML Class Diagram.

Use cases deal only in the functional requirements for a system. Other requirements such as business rules, quality of service requirements, and implementation constraints must be represented separately. Architecture and internal details must also be described separately.

Roles include:

• Actors
• Use case
• Association
• System

### Class diagram

A UML class diagram describes data types and their relationships separately from their implementation. The diagram is used to focus on the logical aspects of the classes, instead of their implementation.

You can use a UML class diagram for a variety of purposes:

• To provide an implementation-independent description of the types that are used in a system and passed between its components.

For example, the type Meal Order might be implemented in .NET code in the business layer, in XML at the interfaces between components, in SQL in the database, and in HTML in the user interface. Although these implementations are different in detail, the relationship between a Meal Order and other types, such as Menu and Payment, is always the same. The UML class diagram makes it possible to discuss these relationships separately from the implementations.

• To clarify the glossary of terms used for communication between the application and its users, and in descriptions of the users' needs. See Model user requirements.

For example, consider the user stories, use cases or other requirements descriptions of a restaurant application. In such a description, you would find terms like Menu, Order, Meal, Price, Payment, and so on. You could draw a UML class diagram that defines the relationships between these terms. This will reduce the risk of inconsistencies in the requirements descriptions, and in the user interface, and in the help documents.

• + means public
• - means private
• # means Protected members

#### Generalization, Association

Generalization and association are the two main ways to reuse code.

Generalization
is a term signifying the inheritance of a class or the implementation of an interface.
Association
is has-a relationship.
##### Generalization
• Form: empty arrow.
• Inheritance.
##### Association
• It defines multiplicity (1 to 1, 1 to many, many to 1, 1 to 2, ..., and many to many).
• Objects of one class are included as members in the other class.
• Form: straight line.
##### Composition
• An aggregation where the components cannot exist without the aggregate.
• In a composition, the complex object "owns" all of the subobjects it is composed of.
• When a composition is destroyed, all of the subobjects are destroyed as well.
• Form: filled rhombus.
##### Aggregation
• A special type of association.
• It models the relationship of kind "whole / part".
• The parent class as an aggregate, and the aggregated classes are called components.
• No ownership between the complex object and the subobjects is implied. When an aggregate is destroyed, the subobjects are not destroyed.
• Form: empty rhombus.

### Activity diagram

An activity diagram helps you explain a more complex process where there are loops, branches and parallel threads. It can also show the flow of data between parts of the process.

### Sequence diagram

A sequence diagram helps you explain a complex series of interactions between different actors. You can also use it to show what happens inside the system in response to each use case.

# ArgoUML

Tigris.  

java -jar argouml.jar -help

# Switch back to the English UI. Please beware: the language is in lowercase.
java -jar argouml.jar -locale en

# Run without UI
java -jar argouml.jar -batch -command "org.argouml.uml.ui.ActionOpenProject=c:\Documents and Settings\Michiel\My Documents\test.zargo" -command org.argouml.ui.cmd.ActionGotoDiagram=A -command "org.argouml.uml.ui.ActionSaveGraphics=c:\Documents and Settings\Michiel\My Documents\test.PNG"