Introduction to UML For OOM - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Introduction to UML For OOM

Description:

Role and navigability = how to read the association. A copy is a copy of a book. Navigability can be uni-directional or bi-directional ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 25
Provided by: julie57
Category:

less

Transcript and Presenter's Notes

Title: Introduction to UML For OOM


1
Introduction to UML For OOM
  • Outline the purpose of UML
  • List key UML diagrams
  • State their role in development
  • Describe the components of a class diagram
  • Inheritance (generalisation/specialisation)
  • Aggregation (part/whole)
  • Association (general links between classes)
  • Tutorial http//dn.codegear.com/article/31863
  • Various resources http//www.uml.org/

2
Summary
  • Introduction to OO methodologies and UML
  • Outline of UML
  • Use Case Diagrams
  • Class Diagrams
  • State Diagrams
  • Sequence Diagrams
  • Collaboration Diagrams
  • Variety of Implementation Diagrams
  • Class Models in UML
  • Class diagrams

3
Object-Oriented Modelling
  • What is a Model?
  • An abstract representation of system
  • Why Model?
  • Help thought communication
  • Claims for OO Modelling
  • objects closer to reality than functions
  • Better representation
  • E.g size of model change will relate to
    requirements change
  • closer links between analysis and implementation
  • If using OOP, should use OOM

4
Methodologies for OO Modelling
  • Many similar methods developed in 1980s
  • (OOSE, OMT, Fusion, Booch (OOD))
  • developed from OO programming languages
  • based on structured methods
  • SSADM, Yourdon, Structured Analysis
  • Unified Modelling Language (1990s)
  • collaboration by three key developers of OO
    methods
  • Grady Booch, Ivar Jacobson, and Jim Rumbaugh.
  • Unify best practice
  • Set a standard for OO modelling methods.
  • UML is standardised
  • The Object Management Group (OMG)

5
An Overview of UML
  • A collection of compatible modelling techniques
  • Not a modelling methodology
  • allows use of appropriate approach for a project
  • but offers no guidance

6
UML Modelling Techniques
  • Use Case Modelling
  • Use case diagrams
  • Use case descriptions
  • Static Structure Diagrams
  • Class diagrams
  • Object diagrams
  • Interaction Diagrams
  • Sequence diagrams
  • Collaboration diagrams
  • State Diagrams
  • State diagrams
  • Activity diagrams
  • Implementation Diagrams
  • Package diagrams
  • Component diagrams
  • Deployment diagrams

7
Diagram Overviews
  • Use Case Diagrams
  • interaction between system and external entities
    (actors)
  • Use specification and testing
  • Class Diagram
  • classes and relationships between them.
  • Single class model may use several diagrams for
    legibility.
  • Use specification design
  • Object Diagram
  • diagram for relationships between specific
    objects.
  • Use specification and design

8
Interaction Diagrams
  • Sequence Diagram
  • How objects interact over time to handle a
    situation
  • Timing of messages (methods called) between
    objects
  • Use
  • specification and design
  • Collaboration Diagram
  • An object diagram showing links between objects
    and using numbered arrows to indicate a sequence
    of events.
  • Use
  • specification and design

9
State Activity Diagrams
  • State Diagram
  • How events change an object's state and its
    behaviour
  • Use specification and design
  • Activity Diagram
  • Represents tasks performed by actors and
    interactions
  • The closest thing to a flowchart in modern
    software development
  • Use specification and design

10
Implementation Diagrams
  • Package Diagram
  • Logical grouping of classes and packages
  • Use detailed design
  • Component Diagram
  • How code is divided into physical modules.
  • Use implementation
  • Deployment diagrams
  • The physical architecture of the application.
  • Nodes usually represent hardware platforms.
  • Use implementation

11
UML Class Diagrams
  • A class has
  • name
  • attribute components
  • operation components
  • Class diagram shows classes inter-relationships
  • A diagram represents part of the class model
  • A class in the model may appear on none, one or
    several diagrams

12
Class Diagram Examples
  • A simple class
  • A class with attributes and operations

13
Example parameterized class
  • The List class definition leaves class T
    unspecified - possibly any class
  • A template
  • ltltbindgtgt is a stereotype
  • Stereotypes give added information about UML
    components.
  • The T class is replaced (bound to) by the Book
    class
  • A BookList object is a list of Books

ltltbindgtgt(Book)
Listltintgt
An unnamed list of integers
14
Class Members
  • Attributes
  • descriptive name
  • type or class
  • may have
  • an initial value
  • visibility
  • Visibility Categories
  • public - accessed by any client of the class
  • protected accessed by descendants
  • Also called derived classes / specialisations
  • private - only by members of the same class

15
Operations
  • Every operation must have descriptive name
  • An operation may have
  • A return type
  • Arguments
  • Each argument must have a name and a type
  • May have a default value
  • Visibility

16
Relationships
  • 3 main types of relationship
  • generalisation/specialisation (inheritance "is
    a")
  • aggregation (whole-part has a and contains)
  • association (any other relationship)

17
Association
  • Shows logical links between classes
  • Multiplicity (cardinality) - number of objects
    involved
  • exact number 1
  • a range 2..5
  • unspecified (many)
  • Role and navigability how to read the
    association
  • A copy is a copy of a book
  • Navigability can be uni-directional or
    bi-directional
  • Given an object at one end of the link, can we
    find the other end?
  • Uni-directional links can be implemented by a
    pointer

18
Qualified association
  • A qualifier is a list of attributes whose values
    serve to partition the set of instances at the
    other end of the association.
  • There will be 9 squares
  • Each defined by a row, column value pair in the
    board

Qualifier attributes row column
19
Derived association
takes
Student
Module
/teaches
delivers
Lecturer
  • The 'teaches' relationship can be inferred from
    the others so need not be directly implemented
  • A derived association is shown by the slash.
  • The black triangles can be used on any
    association name to show how to read the
    association

20
Xor-constraint
  • A copy will be either a book or a journal

0..
Copy
Book
xor
0..1
Journal
The equivalent of a C Union
21
Association classes
  • Allows attributes and operations relating to the
    association to be specified explicitly

22
Generalisation (Inheritance)
  • One class is a specialized version of another
  • Check for correctness check substitutability.
  • Can use a specialised object in place of the
    ancestor
  • NOT the other way around.
  • The classes should be logically related
  • Ask is child a sort of parent

23
Aggregation
  • Represent 'whole-part' relationships
  • Aggregation one object can be included in
    another
  • Composition one object is part of the structure
    of another
  • Can the 'whole' be destroyed while the 'parts'
    remain ?
  • yes aggregation
  • no composition

24
Summary
  • UML is a standardised set of notations
  • Can be used in different methodologies
  • UML diagrams cover much of the lifecycle
  • Class diagram shows part of a class model
  • Class model displays static relationships
  • Inheritance
  • Aggregation
  • Aggregation container
  • Composition component parts
  • Association
Write a Comment
User Comments (0)
About PowerShow.com