ict117 week08 structural modelling

Upload: danny-manno

Post on 07-Apr-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 ICT117 Week08 Structural Modelling

    1/27

    PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd EditionCopyright 2009 John Wiley & Sons, Inc. All rights reserved.

    Structural ModelingChapter 6: Dennis, Wixom and

    Tegarden

  • 8/6/2019 ICT117 Week08 Structural Modelling

    2/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    2

    ObjectivesUnderstand the rules and style guidelines forcreating CRC cards, class diagrams, andobject diagrams.Understand the processes used to create CRCcards, class diagrams, and object diagrams.Be able to create CRC cards, class diagrams,and object diagrams.Understand the relationship between thestructural and use case models.

  • 8/6/2019 ICT117 Week08 Structural Modelling

    3/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    3

    Structural ModelA formal way of representing the objects thatare used and created by a business systemPeople

    Places

    Things

    Drawn using an iterative processFirst drawn in a conceptual, business-centric way

    Then refined in a technology-centric waydescribing the actual databases and files

  • 8/6/2019 ICT117 Week08 Structural Modelling

    4/27

    PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd EditionCopyright 2009 John Wiley & Sons, Inc. All rights reserved.

    STRUCTURAL MODELS

  • 8/6/2019 ICT117 Week08 Structural Modelling

    5/27

  • 8/6/2019 ICT117 Week08 Structural Modelling

    6/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    6

    A Common LanguageStructural models create a well-definedvocabulary shared by users and analystsClasses created during analysis are not the classes

    that programmers develop during implementationThis refinement comes later

    Typical structural models:CRC cards

    Class (and Object) diagrams

  • 8/6/2019 ICT117 Week08 Structural Modelling

    7/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    7

    Classes: Attributes &Operations ClassesTemplates for instances of people,

    places, or things

    AttributesProperties that describe the state

    of an instance of a class (an object)

    OperationsActions or functions that a class

    can perform

  • 8/6/2019 ICT117 Week08 Structural Modelling

    8/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    8

    RelationshipsDescribe how classes relate to one anotherThree basic types in UML

    GeneralizationEnables inheritance of attributes and operations

    AggregationRelates parts to wholes

    AssociationMiscellaneous relationships between classes

  • 8/6/2019 ICT117 Week08 Structural Modelling

    9/27

    PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd EditionCopyright 2009 John Wiley & Sons, Inc. All rights reserved.

    CRC CARDS

    CRC = Class Responsibilities and

    Collaborations

  • 8/6/2019 ICT117 Week08 Structural Modelling

    10/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    10

    Responsibilities &CollaborationsResponsibilities

    Knowing

    DoingCollaborationObjects working together to service a request

    Refer page 211

  • 8/6/2019 ICT117 Week08 Structural Modelling

    11/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    11

    Front-Side of a CRC Card

  • 8/6/2019 ICT117 Week08 Structural Modelling

    12/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    12

    Back-Side of a CRC Card

  • 8/6/2019 ICT117 Week08 Structural Modelling

    13/27

    PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd EditionCopyright 2009 John Wiley & Sons, Inc. All rights reserved.

    CLASS DIAGRAMS

  • 8/6/2019 ICT117 Week08 Structural Modelling

    14/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    14

    Elements of a Class Diagram

  • 8/6/2019 ICT117 Week08 Structural Modelling

    15/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    15

    Attribute VisibilityAttribute visibility can be specified in the classdiagramPublic attributes (+) are visible to all classes

    Private attributes (-) are visible only to an instanceof the class in which they are defined

    Protected attributes (#) are like private attributes,

    but are also visible to descendant classes

    Visibility helps restrict access to the attributesand thus ensure consistency and integrity

  • 8/6/2019 ICT117 Week08 Structural Modelling

    16/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    16

    OperationsConstructorCreates object

    QueryMakes information about state available

    UpdateChanges values of some or all attributes

  • 8/6/2019 ICT117 Week08 Structural Modelling

    17/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    17

    More Elements of ClassDiagrams

  • 8/6/2019 ICT117 Week08 Structural Modelling

    18/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    18

    MultiplicitiesDepartment

    1

    Boss

    1

    Employee

    1

    Child

    0..*

    Boss

    1

    Employee

    1..*

    Exactly one:

    A department has one

    and only one boss

    Zero or more:An employee has zero

    to many children

    One or more:

    A boss is responsible for

    one or more employees

  • 8/6/2019 ICT117 Week08 Structural Modelling

    19/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    19

    More MultiplicitiesEmployee

    1

    Spouse

    0..1

    Employee

    1

    Vacation

    2..4

    Employee

    1

    Committee

    1..3, 5

    Zero or one:

    An employee can be

    married to 0 or 1 spouse

    Specified range:An employee can take 2

    to 4 vacations each year

    Multiple disjoint ranges:

    An employee can be in 1

    to 3 or 5 committees

  • 8/6/2019 ICT117 Week08 Structural Modelling

    20/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    20

    Sample Class Diagram

  • 8/6/2019 ICT117 Week08 Structural Modelling

    21/27

  • 8/6/2019 ICT117 Week08 Structural Modelling

    22/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    22

    Object Diagrams

  • 8/6/2019 ICT117 Week08 Structural Modelling

    23/27

    PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd EditionCopyright 2009 John Wiley & Sons, Inc. All rights reserved.

    CREATING CRC CARDS AND

    CLASS DIAGRAMS

  • 8/6/2019 ICT117 Week08 Structural Modelling

    24/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    24

    Object IdentificationTextual analysis of use-case informationNouns suggest classes

    Verbs suggest operations

    Creates a rough first cutCommon object listIncidentsRoles

  • 8/6/2019 ICT117 Week08 Structural Modelling

    25/27

  • 8/6/2019 ICT117 Week08 Structural Modelling

    26/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    26

    7 Steps to Structural ModelsCreate CRC CardsExamine common object listsRole-play the CRC cardsCreate the class diagramReview the class diagramIncorporate patternsReview the model

  • 8/6/2019 ICT117 Week08 Structural Modelling

    27/27

    17 March, 2011 ICT117 Systems Analysis & Design, Semester 1, 2011

    Includes John Wiley & Sons Inc material

    27

    Next lectureBehavioural ModelsInteraction diagramsState MachinesCRUD analysis