oo concept chapt3 part1

Upload: scodrash

Post on 02-Jun-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 OO Concept Chapt3 Part1

    1/39

    Chapter 3Modeling With

    1

    Unified Modeling Language(UML)

  • 8/10/2019 OO Concept Chapt3 Part1

    2/39

    Learning Outcome

    Describe :

    What is meant by a model

    2 2010 Bennett, McRobb and Farmer

    The distinction between a model and

    a diagram

    The UML concept of a model

  • 8/10/2019 OO Concept Chapt3 Part1

    3/39

    What is Model?

    A model is an abstract representation of asystem, constructed to understand the system

    prior to building or modifying it

    3

    s mp e represen a on o rea y ur an,1993]

    A model provides a means for

    conceptualization and communication of ideasin a precise and unambiguous form

    More typically are represented by diagrams

  • 8/10/2019 OO Concept Chapt3 Part1

    4/39

    What is a Diagram?

    Abstract shapes are used to representthings or actions from the real world

    Diagrams follow rules or standards

    4 2010 Bennett, McRobb and Farmer

    The standards make sure that differentpeople will interpret the diagram in the

    same way

    40

  • 8/10/2019 OO Concept Chapt3 Part1

    5/39

    Diagrams vs. Models

    A diagram illustrates some aspect of a system.A model provides a complete view of a system

    at a particular stage and from a particular

    5 2010 Bennett, McRobb and Farmer

    perspec ve.A model may consist of a single diagram, but

    most consist of many related diagrams and

    supporting data and documentation.

  • 8/10/2019 OO Concept Chapt3 Part1

    6/39

    Why Use a Model?

    A model is quicker and easier to buildthan the real thing

    A model can be used in a simulation

    6 2010 Bennett, McRobb and Farmer

    A model can evolve as we learn

    We can choose which details to include in

    a model

    A model can represent real or imaginary

    things from any domain

  • 8/10/2019 OO Concept Chapt3 Part1

    7/39

    What is Modeling?

    Modeling frequently is used during many of thephases of the software life cycle (e.g., analysis and

    design)

    7

    design involve graphic languages (sets of symbols)

    The system needs to be examined from various

    perspectives and its features need to be modeled

    Modeling enables us to cope with the complexity of a

    system

  • 8/10/2019 OO Concept Chapt3 Part1

    8/39

    Why modeling?

    Building a model for a software system prior to itsconstruction is as essential as having a blueprint

    for building a large building

    8

    teams

    The use of visual notation to represent or model a

    problem can provide us several benefits relating

    to clarity, familiarity, maintenance, andsimplification

  • 8/10/2019 OO Concept Chapt3 Part1

    9/39

    Modelling Organizations

    Organizations are human activity systems. The situation is complex

    Stakeholders have different views

    9 2010 Bennett, McRobb and Farmer

    We have to model requirementsaccurately, completely and unambiguously

    The model must not prejudge the solution

  • 8/10/2019 OO Concept Chapt3 Part1

    10/39

    Modeling Notations

    It is important to have standard notations for

    modeling, documenting, and communicatingdecisions

    requirements thoroughly

    Holes in the models reveal unknown or

    ambiguous behavior

    Multiple, conflicting outputs to the same input

    reveal inconsistencies in the requirements

  • 8/10/2019 OO Concept Chapt3 Part1

    11/39

    Modeling key ideas

    Clarity easily can understand the system

    Familiarity similar to the way in which theinformation actually is represented and used

    Maintenance make chan es faster and less

    11

    errors Simplification simplicity and conceptual

    understanding

    a model is rarely correct on the first try always seek the advice and criticism of others

    avoid excess model revisions, as they can distortthe essence of your model

  • 8/10/2019 OO Concept Chapt3 Part1

    12/39

    What is UML? UnifiedModeling Language

    Is a language. It is not simply a notation for drawing

    diagrams, but a complete language for capturing

    knowledge(semantics) about a subject and expressing

    knowledge(syntax) regarding the subject for the

    purpose o commun cat on. Applies to modeling and systems. Modeling involves a

    focus on understanding a subject (system) and

    capturing and being able to communicated in this

    knowledge.

    It is the result of unifying the information systems and

    technology industrys best engineering practices

    (principals, techniques, methods and tools).

  • 8/10/2019 OO Concept Chapt3 Part1

    13/39

    What is UML? Convergence of different notations used in object-oriented methods, mainly

    OMT (James Rumbaugh and collegues), OOSE (Ivar Jacobson), Booch

    (Grady Booch)

    They also developed the Rational Unified Process, which became the Unified

    Process in 1999

    ,

    , ()

    1,

    1,

    ,

    1,

    //..

    (),

    1,

    00

    //..

    /

  • 8/10/2019 OO Concept Chapt3 Part1

    14/39

    What is UML?

    Nonproprietary standard for modeling software systems,

    OMG Convergence of notations used in object-oriented methods

    OMT (James Rumbaugh and collegues)

    OOSE (Ivar Jacobson)

    Current Version: UML 2.2

    Information at the OMG portal http://www.uml.org/

    Commercial tools: Rational (IBM),Together (Borland), Visual Architect(business processes, BCD)

    Open Source tools: ArgoUML, StarUML, Umbrello

    Commercial and Opensource: PoseidonUML (Gentleware)

  • 8/10/2019 OO Concept Chapt3 Part1

    15/39

    UML

    used for both database and software modeling

    version 1.1 was adopted in November 1997 by theObject Management Group (OMG) as a standard

    language for object-oriented analysis and design

    Initially based on a combination of the Booch, OMT(Object Modeling Technique) and OOSE (Object-

    Oriented Software Engineering) methods, UML was

    refined and extended by a consortium of several

    companies, and is undergoing minor revisions by theOMG Revision Task Force.

    Ivar Jacobson is known as the father of Use Cases.

    References www.inconcept.com/JCM/April1998/halpin.html15

  • 8/10/2019 OO Concept Chapt3 Part1

    16/39

    Modeling and the UML

    The larger the project is , the more importantthe modeling is.

    Unified Modeling Language (UML) is the

    16

    language that has been adopted by ObjectManagement Group (OMG)

    UML provides a wide variety of notations for

    modeling many aspects of software systems

  • 8/10/2019 OO Concept Chapt3 Part1

    17/39

    Different types of

    17

    models

  • 8/10/2019 OO Concept Chapt3 Part1

    18/39

    Conceptual, Logical, andPhysical Models

    The products of analysis and design areexpressed through conceptual, logical, and

    physical models

    18

    They are expressive enough to allow adeveloper to capture all of the decisions that

    need to be made during the analysis of a

    system and complete enough to serve asblueprints for implementation

  • 8/10/2019 OO Concept Chapt3 Part1

    19/39

    Conceptual, Logical, and

    Physical Models

    The conceptual model captures the systemin terms of the domain entities that exist (or

    will exist) and their association with other

    19

    suc ent t es o your system The conceptual level of modeling is

    performed using the terminology of your

    business domain and should be technology-agnostic

  • 8/10/2019 OO Concept Chapt3 Part1

    20/39

  • 8/10/2019 OO Concept Chapt3 Part1

    21/39

  • 8/10/2019 OO Concept Chapt3 Part1

    22/39

    Unified Process and UMLTransition

    Construction

    Elaboration

    Inception

    methodology

    22

    Software development is a process in phases This process has to follow a methodology

    Each phase is supported by graphs & diagrams

    The are different kinds of documents and varioususage of them

    UML is an essential language for diagrams, offeringcomputer support as well as the right patterns for thevarious stages of refinement and viewpoints

  • 8/10/2019 OO Concept Chapt3 Part1

    23/39

    UML Diagrams

    Every complex system is best approached

    through a small set of nearly independentviews of a model no single view is

    23

    The choice of what models or diagrams one

    creates has a great influence on how a

    problem is encountered and how a

    corresponding solution is shaped

  • 8/10/2019 OO Concept Chapt3 Part1

    24/39

    Diagrams in UML

    UML diagrams consist of:

    icons

    two-dimensional symbols

    Plan Chapter

    Produce

    First Draft

    24 2010 Bennett, McRobb and Farmer

    pat s Strings

    UML diagrams are defined inthe UML specification.

    Revise Draft

    [satisfied]

    [not satisfied]

    Add Exercises

    Add References

    to Bibliography

  • 8/10/2019 OO Concept Chapt3 Part1

    25/39

    Relationship between Models

    and Diagrams

    Use Case Diagrams are one view of the UseCase Model in the Requirements Model

    25 2010 Bennett, McRobb and Farmer

    equ remen s o e

    Use CasesInterface

    Prototypes

    Requirements

    List

    Initial System

    ArchitectureModel

    Glossary

    Use Case Model

    Assign staff

    towork on

    acampaign

    CampaignManager

    Add anew

    advertto

    acampaign

    Check campaign

    budget

    Findcampaign

    Accountant

    summaryPrint campaign

    invoice

    include

    extend extend

    Printcampaign

    include

    include

    Campaign Management

    Use Case Diagrams

    One View of the Use Case Model

    Assign staff

    towork on

    acampaign

    CampaignManager

    Add anew

    advertto

    acampaign

    Check campaign

    budget

    Findcampaign

    Accountant

    summaryPrint campaign

    invoice

    include

    extend extend

    Printcampaign

    include

    include

    Campaign Management

  • 8/10/2019 OO Concept Chapt3 Part1

    26/39

    Examples of Models

    Requirements Model complete view of requirements

    may include other models, such as a Use

    26 2010 Bennett, McRobb and Farmer

    Case Model includes textual description as well as sets of

    diagrams

  • 8/10/2019 OO Concept Chapt3 Part1

    27/39

    Examples of Models

    Behavioural Model shows how the system responds to events

    in the outside world and the passage of

    27 2010 Bennett, McRobb and Farmer

    time an initial model may just use

    Communication Diagrams

    a later model will include SequenceDiagrams and State Machines

  • 8/10/2019 OO Concept Chapt3 Part1

    28/39

    Models in UML

    A system is the overall thing that is beingmodelled

    A subsystem is a part of a system

    28 2010 Bennett, McRobb and Farmer

    cons s ng o re a e e emen sA model is an abstraction of a system or

    subsystem from a particular perspective

    A model is complete and consistent at thechosen level of abstraction

  • 8/10/2019 OO Concept Chapt3 Part1

    29/39

    Models in UML

    Different models present different views ofthe system, for example:

    use case view

    29 2010 Bennett, McRobb and Farmer

    es gn v ew

    process view

    implementation view

    deployment view (Booch et al., 1999)

  • 8/10/2019 OO Concept Chapt3 Part1

    30/39

    PackageDiagram

    ClassDiagram

    ComponentDia ram

    Use CaseDiagram

    ActivityDiagram

    State

    Behavior DiagramsStructure Diagrams

    UML Diagrams

    30

    DeploymentDiagram

    Object

    Diagram

    CompositeStructureDiagram

    Machine

    Diagram

    Sequence

    Diagram

    Communication

    Diagram

    InteractionOverviewDiagram

    TimingDiagram

    Interaction Diagrams

  • 8/10/2019 OO Concept Chapt3 Part1

    31/39

    Structure Diagrams

    Used to show the static structure ofthe system and how those parts arerelated to each other.

    31

    The element in a structure diagramrepresent the meaningful concepts ofa system, and may include abstract,

    real world and implementationconcepts.

  • 8/10/2019 OO Concept Chapt3 Part1

    32/39

    Behavior Diagrams

    To express the dynamicbehavioral of the objects in a

    32

    .

    Can be described as a series of

    changes to the system over time

  • 8/10/2019 OO Concept Chapt3 Part1

    33/39

    Interaction Diagrams Used to describe some type of interactions among the

    different elements in the model.

    Performed on a per Use Case basis, examine the flow ofmethod call calls within a system.

    Performin a com lete anal sis re uires that each Use Case

    33

    must be examined, although in practice only selected Usecases may be examined.

    The purposes of interaction diagrams are to visualize the

    interactive behavior of the system. Now visualizing interaction

    is a difficult task. So the solution is to use different types ofmodels to capture the different aspects of the interaction.

    That is why sequence and collaboration diagrams are used to

    capture dynamic nature but from a different angle.

  • 8/10/2019 OO Concept Chapt3 Part1

    34/39

    Interaction Diagrams

    Sequence diagram displays the time sequence ofthe objects participating in the interaction; consists ofthe vertical dimension (time) and horizontaldimension (different objects)

    34

    Collaboration Diagram

    displays an interactionorganized around the objects and their links to oneanother. Numbers are used to show the sequence ofmessages.

  • 8/10/2019 OO Concept Chapt3 Part1

    35/39

  • 8/10/2019 OO Concept Chapt3 Part1

    36/39

  • 8/10/2019 OO Concept Chapt3 Part1

    37/39

    Recap

    Describe : What is meant by a model

    37

    The distinction between a model and

    a diagram

    The UML concept of a model

  • 8/10/2019 OO Concept Chapt3 Part1

    38/39

    References

    Bruegge Dutoit (2010)

    Bennet, McRobb and Farmer (2010)

    The Elements of UML 2.0 Style, Scott W. Ambler,

    on n n erna ona ,

    The Object Primer 3rd Edition, Scott W. Ambler,

    Cambridge University Press, 2004

    UML Distilled: A Brief Guide to the Standard Object

    Modeling Language (3rd Edition), Martin Fowler,Addison-Wesley Professional, 2004

  • 8/10/2019 OO Concept Chapt3 Part1

    39/39

    Additional References

    Grady Booch,James Rumbaugh,Ivar Jacobson

    The Unified Modeling Language User Guide, Addison Wesley,2nd edition, 2005

    Commercial UML tools

    http://www-306.ibm.com/software/awdtools/developer/java/

    Together (Eclipse, MS Visual Studio, JBuilder) http://www.borland.com/us/products/together/index.html

    Open Source UML tools

    http://java-source.net/open-source/uml-modeling ArgoUML,UMLet,Violet,