Class Diagrams - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Class Diagrams

Description:

Association represents a relationship between two or more classes. ... Navigability. Name of association. OOT5. 7. 01/02. Association (Cont) Association class ... – PowerPoint PPT presentation

Number of Views:16
Avg rating:3.0/5.0
Slides: 18
Provided by: Hum26
Category:

less

Transcript and Presenter's Notes

Title: Class Diagrams


1
Class Diagrams
2
Class
Visibility
SomeClass
Attribute1 Attribute2 Type -Attribute3
Public Protected Private
  • Operation1(para1type)Type
  • Operation2()void
  • Operation3()

3
Class (Cont)
Abbreviated form
SomeClass
4
Object
someObject SomeClass
Abbreviated form
someObject SomeClass
5
Relationships between Classes
  • There are four types of relationships between
    classes
  • Association represents a relationship between
    two or more classes.
  • Aggregation represents whole/part
    relationships.
  • Composition represents whole/part
    relationships. A special form of aggregation,
    with strong ownership and coincident lifetime as
    part of whole. The parts are removed before the
    death of the composite.
  • Generalization (Inheritance) represents
    generalization/specialization relationships.

6
Association
Navigability
Name of association
Role of company
Multiplicity
7
Association (Cont)
Association class
8
Association (Cont)
  • N-ary association.

Quaternary (four-way) association
9
Association (Cont)
directory ? 0 or n files
Qualifier
(directory, file name) ? 0 or 1 file
10
Association (Cont)
  • Qualifier is a slot for an attribute or list of
    attributes on a binary association, in which the
    values of the attributes select a unique or a set
    of related objects from the entire set of objects
    related to an object by the association.
  • Example (directory, file name) ? 0 or 1 file
  • Qualifier is an index on the traversal of an
    association.

11
Association (Cont)
(bank, account no.) ? 0 or 1 person person ? 0 or
n (bank, account no.)
12
Aggregation
  • A plain association between two classes
    represents a structural relationship between
    peers.
  • The composite object may exist without its
    constituent objects.
  • The object may be a constituent of more than one
    composite.

13
Aggregation (Cont)
Whole
Part
Aggregation
14
Composition
  • Composition represents whole/part
    relationships.
  • A special form of aggregation, with strong
    ownership and coincident lifetime as part of
    whole.
  • The parts are removed before the death of the
    composite.

15
Composition (Cont)
16
Generalization
  • A relationship between a general thing (called
    the super-class or parent) and a more specific
    kind of that thing (called the subclass or
    child).
  • Generalization means the objects of the child may
    be used anywhere where the parent may appear, but
    not in the reverse.
  • A child may have attributes and operations in
    addition to those found in its parent.
  • A child may override the implementation of an
    operation of its parent.
  • A class may have zero or more parents.

17
Generalization (Cont)
Write a Comment
User Comments (0)
About PowerShow.com