6n7 UML Basics

Embed Size (px)

Citation preview

  • 8/2/2019 6n7 UML Basics

    1/27

    UML Basics

    1

    UML Basics

    Design Model

    Process Model

    Deployment Model

  • 8/2/2019 6n7 UML Basics

    2/27

    UML Basics

    2

    What Is the UML?

    The UML is a language for Visualizing

    Specifying

    Constructing

    Documenting

    the artifacts of a software-intensive system.

    The Unified Modelling Language (UML) is an

    industry standard for object oriented designnotation, supported by the Object ManagementGroup (OMG).

  • 8/2/2019 6n7 UML Basics

    3/27

    UML Basics

    3

    The UML Is a Language for Visualizing

    Communicating conceptualmodels to others is prone to errorunless everyone involved speaksthe same language.

    There are things about a softwaresystem you cant understand

    unless you build models.

    An explicit model facilitatescommunication.

  • 8/2/2019 6n7 UML Basics

    4/27

    UML Basics

    4

    The UML Is a Language for Specifying

    The UML builds models that are precise,unambiguous, and complete.

  • 8/2/2019 6n7 UML Basics

    5/27

    UML Basics

    5

    The UML Is a Language for Constructing

    UML models can be directly connected to avariety of programming languages.Maps to Java, C++, Visual Basic, and so on

    Tables in a RDBMS or persistent store in anOODBMS

    Permits forward engineering

    Permits reverse engineering

  • 8/2/2019 6n7 UML Basics

    6/27

    UML Basics

    6

    The UML Is a Language for Documenting

    Use Case Diagram

    Actor A

    Use Case 1

    Use Case 2

    Use Case 3

    Actor B

    Class Diagram

    GrpFile

    read( )

    open( )

    create( )

    fi l lFile( )

    rep

    Repository

    name:char *= 0

    readDoc( )

    readFile( )

    (fromPersistence)

    FileMgr

    fetchDoc( )

    sortByName( )

    DocumentList

    add( )

    delete( )

    Document

    name:int

    docid:int

    numField:int

    get( )

    open( )

    close( )

    read( )

    sortFileList( )

    create( )

    fillDocument( )

    fList

    1

    FileList

    add( )

    delete( )

    1

    File

    read( )

    read() fil l the

    code..

    Sequence Diagram

    user

    m ai nW nd f il eM gr :

    FileMgr

    repository document:

    Document

    gFile

    1:Doc view request( )

    2:fetchDoc( )

    3:create( )

    4:crea

    te( )

    5:readDoc ( )

    6:fil lDocument( )

    7:readFile( )

    8:fil lFile( )

    9:sortByName( )

    .

    .

    .

    The UML addresses documentation of system architecture,

    requirements, tests, project planning, and releasemanagement.Deployment Diagram

    Window95

    .EXE

    Windows NT

    .EXE

    Windows

    NT

    Windows95

    Solaris

    .EXE

    AlphaUNIX

    IBM

    Mainframe

    Windows95

    - 95:

    - NT:

    - : ,

    - IBM : ,

  • 8/2/2019 6n7 UML Basics

    7/27

    UML Basics

    7

    History of the UML

    UML 1.0(Jan. 97)

    UML 1.1(Sept. 97)

    UML 1.5(March, 03)

    UML 2.0(2004)

    OtherMethods

    Booch 91 OMT - 1OOSE

    Booch 93 OMT - 2

    Public

    FeedbackUnified Method 0.8(OOPSLA 95)

    UML 0.9(June 96)

    UML 0.91(Oct. 96)

    and

  • 8/2/2019 6n7 UML Basics

    8/27

    UML Basics

    8

    Diagrams

    Diagrams graphically depict a view of a part of yourmodel.

    Different diagrams represent different views of thesystem that you are developing.

    A model element will appear on one or morediagrams.

  • 8/2/2019 6n7 UML Basics

    9/27

    UML Basics

    9

    UML Diagrams in Software Architecture

    BehavioralDiagrams

    StructuralDiagrams

    ActivityDiagrams

    SequenceDiagrams

    CommunicationDiagrams

    State MachineDiagrams DeploymentDiagrams

    ComponentDiagrams

    CompositeStructureDiagrams

    ClassDiagramsUse-CaseDiagrams

    Model

  • 8/2/2019 6n7 UML Basics

    10/27

    UML Basics

    10

    Key Diagrams in UML

    Requirements

    System Structure

    System Behaviour

    Use Case Diagrams

    Interaction DiagramsActivity Diagrams

    State Charts

    Class Diagrams

    Collaboration Diagrams

  • 8/2/2019 6n7 UML Basics

    11/27

    UML Basics

    11

    Different diagrams of system for different people

    Process View Deployment View

    Logical View

    Use-Case View

    Implementation View

    End-user

    Functionality

    Programmers

    Software management

    Performance, scalability, throughput

    System integrators System topology, delivery,installation, communication

    System engineering

    Analysts/Designers

    Structure

  • 8/2/2019 6n7 UML Basics

    12/27

    UML Basics

    12

    What is a Use-Case Model?

    A use-case model:Is a model of a systems intended functions

    and its environment

    Serves as a contract between the customerand the developers

    Contains the following diagrams: Use case: Shows a set of use cases and actors and their

    relationships Activity: Shows the flow of events within a use case

    Sequence: Shows how a use case will be implementedin terms of collaborating objects

  • 8/2/2019 6n7 UML Basics

    13/27

    UML Basics

    13

    Use-Case Diagram (Example)

    View Report Card

    Student

    Register for Courses

    Login

    Select Courses toTeach

    Submit Grades

    Professor

    Registrar

    Billing System

    Maintain ProfessorInformation

    Maintain StudentInformation

    Close Registration

    Course Catalog

  • 8/2/2019 6n7 UML Basics

    14/27

    UML Basics

    14

    Activity DiagramAction

    A step in the flow of events

    DecisionFlows split based on a guardcondition

    FlowShow the sequence ofactivities

    ForkBeginning of concurrent flows

    JoinEnd of concurrent flow

  • 8/2/2019 6n7 UML Basics

    15/27

    UML Basics

    15

    Activity Diagram (Example)

    SynchronizationBar (Fork)

    GuardCondition

    SynchronizationBar (Join)

    Decision

    ConcurrentThreads

    Transition

    Select Course

    [ add course ]

    CheckSchedule CheckPre-requisites

    Assign toCourse ResolveConflicts

    UpdateSchedule

    Delete Course

    [ checks completed ] [ checks failed ]

    [ delete course ]

    Activity/Action

  • 8/2/2019 6n7 UML Basics

    16/27

    UML Basics

    16

    What is a Design Model?

    A design model:Describes the realization of use cases in terms

    of design elements

    Describes the design of the applicationContains the following diagrams:

    Class: Shows UML classes and relationships

    Component: Shows the structure of elements in the

    implementation model Communication and Sequence: Show how objects and

    classes interact

    State Machine: Shows event-driven behavior

  • 8/2/2019 6n7 UML Basics

    17/27

    UML Basics

    17

    Class Diagram (Design Model)Class diagrams show the static structure of the model, in

    particular, its classes, their internal structure, and theirrelationships to other classes. Class diagrams do not showtemporal information.

    ClassA description of a setof objects

    AttributeNamed property of

    a class

    AggregationRepresents a part-wholerelationship

    OperationClass behavior

    GeneralizationShows an inheritancerelationship

  • 8/2/2019 6n7 UML Basics

    18/27

    UML Basics

    18

    Sequence Diagramused to show how objects interact to perform the behavior of all

    or part of a use case as part of a use-case realization.

    Lifeline

    Shows the life of the object

    Object/ClassShows the object/classinvolved in theinteraction

    MessagesShow data exchanged

    between objects

    Execution OccurrenceShows object executing

  • 8/2/2019 6n7 UML Basics

    19/27

    UML Basics

    19

    Sequence Diagram (Example)

    Activity/Action

    1: create schedule( )

    2: get course offerings( )

    3: get course offerings(for Semester)

    4: get course offerings( )

    6: display blank schedule( )

    :RegisterForCoursesForm :RegistrationController SWTSU Catalog :CourseCatalogSystem

    : Student : Course Catalog

    5: display course offerings( )

    Select Offeringsref

  • 8/2/2019 6n7 UML Basics

    20/27

    UML Basics

    20

    Sequence Diagram: Combined Fragments

    Interaction Use (ref)References another interaction

    Optional Fragment (opt)

    Executed if guard conditionevaluates to true

    Loop (loop)Executed as long as the first

    guard conditionevaluates to true

  • 8/2/2019 6n7 UML Basics

    21/27

    UML Basics

    21

    Communication (Collaboration) Diagramprovide another way to show how objects interact to perform the behavior of a

    particular use case or a part of a use case. Where sequence diagramsemphasize the interactions of objects over time, communication diagrams aredesigned to emphasize the relationships between objects.

    Object/ClassShows theobject/class involvedin the interaction

    MessageShows dataexchangedbetween objects

  • 8/2/2019 6n7 UML Basics

    22/27

    UML Basics

    22

    Communication Diagram (Example)

    : Student

    : RegisterForCoursesForm

    : RegistrationController : CourseCatalogSystem

    5: display course offerings( )

    6: display blank schedule( )

    : Course Catalog1: create schedule( )

    2: get course offerings( )

    3: get course offerings(forSemester)

    4: get course offerings( )

    Links

    Messages

  • 8/2/2019 6n7 UML Basics

    23/27

    UML Basics

    23

    Component Diagram

    ComponentModular parts of the system

    ClassIncluded to show implementation

    relationships.

    It shows the runtime structure of the system at the level of softwarecomponents. Components are the modular parts of the system and are made

    up of groups of related objects that are hidden behind an external interface.

  • 8/2/2019 6n7 UML Basics

    24/27

    UML Basics

    24

    Deployment Diagram

    Artifact

    Represents a physical file

    NodeRepresents aphysical machine

    Owned ElementRelationshipShows another way ofshowing nested elements

    Deployment diagrams show the deployment architecture of the system,

    that is, which of the systems software artifacts reside on which pieces ofhardware.

  • 8/2/2019 6n7 UML Basics

    25/27

    UML Basics

    25

    How Many Diagrams Need to be Created?

    Depends:You use diagrams to visualize the system from different

    perspectives.No complex system can be understood in its entirety

    from one perspective.Diagrams are used for communication

    Model elements will appear on one or morediagrams.For example, a class may appear on one or more class

    diagrams, be represented in a state machine diagram,and have instances appear on a sequence diagram.Each diagram will provide a different perspective.

  • 8/2/2019 6n7 UML Basics

    26/27

    UML Basics

    26

    References Rational Unified Process course Essentials of Rational Unified ProcessEssentials of Rational RequisitePro

    Web-based or Instructor-led trainingMastering Business Modeling with the UML

    Web sitesRationals corporate site: www.rational.comRational Developer NetworkSM: www.rational.net

    Books and articles about requirements management

  • 8/2/2019 6n7 UML Basics

    27/27

    UML Basics

    27

    THANK YOU