Modeling OO Concepts



index
Disabled back button Next Section
printable version




Section 0: Module Objectives or Competencies
Course Objective or Competency Module Objectives or Competency
The student will be able to assess and apply Object-Oriented analysis and design methods... The student will be able to use UML to express OO concepts.


Section 1: Overview

The Unified Modeling Language (UML) is a notation for expressing object-oriented designs.

The most important step of the design phase is designing the individual classes and methods.

This section shows how some of the OO concepts covered earlier are modeled in UML.



Section 2: Class Diagram

A class diagram shows the classes relevant to a portion of a system, as well as the relationships between the classes.



Section 3: Object

The UML notation for an object consists of a rectangle with the object name, followed by a colon, followed by the class name.

Object 1

A second compartment can be added to specify the attribute values for that object, and it lists the attribute name followed by an equals sign and the value.

Object 1


Section 4: Association

There is an association between two classes if it is possible for instances of one of the classes to create or send messages to instances of the second class.

An association is shown by a line that connects the two class boxes.

Association


Section 5: Navigability

One-way navigability may be shown by attaching an arrow to one end of the line; messages may be sent only in the direction indicated by the arrow.

The next diagram indicates that instances of Source may send messages to instances of Target, but not the reverse.

Navigability


Section 6: Multiplicity

Multiplicity values (also called cardinality constraints) may be included at either or both ends of a line linking two class boxes.

Multiplicities

The next diagram shows that an instance of Class A is associated with between four and seven instances of Class B, and that an instance of Class B is associated with exactly one instance of Class A.

Class Example 3


Section 7: Composition

Composition is a kind of association (and is sometimes referred to as "association") that models the whole-part relationship between classes.

Composition

In the following diagram, a Class A object owns one or more instances of Class B.

Class Example 4


Section 8: Aggregation

Aggregation is another kind of association that models the whole-part relationship between classes.

Aggregation

The class diagram below shows that a Class A object contains two Class B objects.

Aggregation 2


Section 9: Inheritance

Inheritance is shown by including a hollow triangle on the parent class end of the line joining two classes.

Generalization

In following diagram, classes Subtype 1 and Subtype 2 both extend Supertype, and Subtype 2 implements Interface 1.

Supertype


Section 10: Example 1

Here is an example UML diagram from this assignment.

Example 1


Section 11: Additional UML Graphical Notation

Here are some additional notations, including some special diagrams:

Interfaces Association Qualified Association
Dependency Parameterized Class Note
Use Case Diagram Activity Diagram State Diagram
Sequence Diagram Collaboration Diagram Deployment Diagram
Concurrent States
X
Interfaces
X
dependency
X
usecase
X
sequence
X
concurrent
X
association
X
parameterized
X
activity
X
collaboration
X
qualified
X
note
X
state
X
deployment