Object Modeling OBJECT-ORIENTED ANALYSIS AND MODELING USING THE UML Read: Chapter 6 - PowerPoint PPT Presentation

1 / 54
About This Presentation
Title:

Object Modeling OBJECT-ORIENTED ANALYSIS AND MODELING USING THE UML Read: Chapter 6

Description:

Synonyms or essential model, conceptual model, and business model. ... Synonyms are bubble chart, transformation graph, and process model. ... – PowerPoint PPT presentation

Number of Views:836
Avg rating:3.0/5.0
Slides: 55
Provided by: ren59
Category:

less

Transcript and Presenter's Notes

Title: Object Modeling OBJECT-ORIENTED ANALYSIS AND MODELING USING THE UML Read: Chapter 6


1
Object ModelingOBJECT-ORIENTED ANALYSIS AND
MODELING USING THE UML Read Chapter 6
  • Dr Manolya Kavakli
  • Department of Computing
  • Macquarie University
  • Sydney, Australia

2
Chapter Objectives
  • Explain how object-oriented analysis can be used
    to describe an information system
  • Define object modeling terms and concepts,
    including objects, attributes, methods, messages,
    classes, and instances
  • Explain relationships among objects and the
    concept of inheritance
  • Draw an object relationship diagram

3
Chapter Objectives
  • Describe Unified Modeling Language (UML) tools
    and techniques, including use cases, use case
    diagrams, class diagrams, sequence diagrams,
    state transition diagrams, and activity diagrams
  • Explain the advantages of using CASE tools in
    developing the object model
  • Explain how to organize an object model

4
Introduction
  • You learn about object-oriented analysis, which
    is another way to view and model system
    requirements
  • You use object-oriented methods to document,
    analyze, and model the information system

5
Introduction to Object Modeling
  • Object-oriented analysis (OOA)
  • an approach used to
  • study existing objects to see if they can be
    reused or adapted for new uses
  • define new or modified objects that will be
    combined with existing objects into a useful
    business computing application
  • Object modeling a technique for identifying
    objects within the systems environment and the
    relationships between those objects.

6
Overview of Object-Oriented Analysis
  • Object-oriented analysis is a popular approach
  • sees a system from the viewpoint of the objects
    themselves as they function and interact

7
Overview of Object-Oriented Analysis
  • Object-Oriented Terms and Concepts
  • Unified Modeling Language (UML)
  • Attributes
  • Methods
  • Message
  • Class
  • Instance

8
Objects, Attributes, Instances
  • Object something that is or is capable of
    being seen, touched, or otherwise sensed, and
    about which users store data and associate
    behavior.
  • Person, place, thing, or event
  • Employee, customer, instructor, student
  • Warehouse, office, building, room
  • Product, vehicle, computer, videotape
  • Attribute the data that represent
    characteristics of interest about an object.
  • Object instance each specific person, place,
    thing, or event, as well as the values for the
    attributes of that object.

9
Objects, Attributes, Instances (cont.)
10
Overview of Object-Oriented Analysis
  • Objects

11
Overview of Object-Oriented Analysis
  • Objects

12
Overview of Object-Oriented Analysis
  • Objects

13
Overview of Object-Oriented Analysis
  • Objects

14
Overview of Object-Oriented Analysis
  • Attributes
  • If objects are similar to nouns, attributes are
    similar to adjectives that describe the
    characteristics of an object
  • Some objects might have a few attributes others
    might have dozens
  • State
  • Describes the objects current status

15
Overview of Object-Oriented Analysis
  • Methods
  • A method defines specific tasks that an object
    can perform
  • Just as objects are similar to nouns and
    attributes are similar to adjectives, methods
    resemble verbs that describe what and how an
    object does something

16
Method (Behavior) Encapsulation
  • Behavior the set of things that the object can
    do that correspond to functions that act on the
    objects data (or attributes).
  • In object-oriented circles, an objects behavior
    is commonly referred to as a method, operation,
    or service.
  • For object order
  • Addorder
  • Deleteorder
  • modifyorder

17
Overview of Object-Oriented Analysis
  • Polymorphism
  • The same message to two different objects can
    producethe same result.
  • Black box
  • A messages triggers changes within the object
    without specifying how the changes must be
    carried out.
  • E.g., Gas pump
  • Blackbox is an example of Encapsulation
  • All data and methods are self-contained.
  • The object prevents its internal code from being
    altered by another object.

18
Overview of Object-Oriented Analysis
  • Messages
  • A major advantage of O-O designs is that systems
    analysts can save time and avoid errors by using
    modular objects, and programmers can translate
    the designs into code, working with reusable
    program modules that have been tested and
    verified
  • These objects could be used by other schools

19
Overview of Object-Oriented Analysis
  • Classes
  • An object belongs to a group or category called a
    class
  • All objects within a class share common
    attributes and methods
  • Subclasses
  • Superclass

20
Overview of Object-Oriented Analysis
  • Classes

21
Relationships Among Objects and Classes
  • Inheritance
  • enables a child object to derive attributes from
    a parent object.
  • Child
  • Parent

22
Relationships Among Objects and Classes
  • Object Relationship Diagram
  • provides an overview of the system.

23
UML
  • Unified Modeling Language (UML) a set of
    modeling conventions that is used to specify or
    describe a software system in terms of objects.
  • The UML does not prescribe a method for
    developing systems
  • only a notation that is now widely accepted as a
    standard for object modeling.
  • DFDs model data and processes
  • UML describes OO systems

24
Object/Class Relationships
  • Object/class relationship a natural business
    association that exists between one or more
    objects and classes.

25
Aggregation
  • Aggregation a relationship in which one larger
    whole class contains one or more smaller
    parts classes. Conversely, a smaller part
    class is part of a whole larger class.

26
Composition
  • Composition an aggregation relationship in
    which the whole is responsible for the creation
    and destruction of its parts. If the whole
    were to die, the part would die with it.

27
Messages
  • Message communication that occurs when one
    object invokes another objects method (behavior)
    to request information or some action

28
Object Modeling with the Unified Modeling Language
  • The UML uses a set of symbols to represent
    graphically the various components and
    relationships within a system
  • It mainly is used to support object-oriented
    systems analysis and to develop object models

29
Object Modeling with the Unified Modeling Language
  • Use Case Modeling
  • Actor
  • Symbol for a use case is an oval with a label
    that describes the action or event
  • Use cases also can interact with other use cases

30
Object Modeling with the Unified Modeling Language
  • Use Case Modeling
  • When the outcome of one use case is incorporated
    by another use case, we say that the second case
    uses the first case
  • Use case description
  • When you identify use cases, try to group all the
    related transactions into a single use case

31
Object Modeling with the Unified Modeling Language
  • Use Case Diagrams
  • Use case diagram
  • System boundary
  • After you identify the system boundary, you place
    the use cases on the diagram, add the actors, and
    show the relationships

32
Object Modeling with the Unified Modeling Language
  • Class Diagrams
  • Class Diagram
  • Evolves into a physical model and finally becomes
    a functioning information system
  • Each class appears as a rectangle, with the class
    name at the top, followed by the classs
    attributes and methods
  • Cardinality

33
Object Modeling with the UML
  • Class Diagrams represents a detailed view of a
    single use case
  • Show classes and their relationships

34
Object Modeling with UML
  • Sequence Diagrams dynamic model of a use case,
    showing the interaction over time
  • Sequence diagram
  • Include symbols such as
  • Classes
  • Lifelines duration of interaction
  • X end of lifeline
  • Messages
  • Focuses indicate when an object sends/receives
    messages

35
Object Modeling with the Unified Modeling Language
  • State Transition Diagrams show how an object
    changes from one stateto another, depending on
    events

36
Object Modeling with the Unified Modeling Language
  • State Transition Diagrams
  • The small circle to the left is the initial
    state, or the point where the object first
    interacts with the system
  • Reading from left to right, the lines show
    direction and describe the action or event that
    causes a transition from one state to another
  • The circle at the right with a hollow border is
    the final state

37
Object Modeling with the Unified Modeling Language
  • Activity Diagrams resembles a horizontal
    flowchart that shows the actions and events as
    they occur

38
Object Modeling with the Unified Modeling Language
  • Activity Diagrams
  • Sequence diagrams, state transition diagrams, and
    activity diagrams are dynamic modeling tools that
    can help a systems analyst understand how objects
    behave and interact with the system

39
Object Modeling with the Unified Modeling Language
  • CASE Tools
  • Object modeling requires many types of diagrams
    to represent the proposed system
  • Creating the diagrams by hand is time-consuming
    and tedious, so systems analysts rely on CASE
    tools to speed up the process and provide an
    overall framework for documenting the system
    components

40
  • UML http//www.youtube.com/watch?v2yoahl1Hf5Ufea
    turerelated
  • MicroSoft Visio
  • http//www.youtube.com/watch?vgCMWCBLl7Q4feature
    related
  • http//www.youtube.com/watch?vxmDjmm0btO8feature
    related

41
Organizing the Object Model
  • You should develop an object relationship diagram
    that provides an overview of the system
  • You should organize your use cases and use case
    diagrams so they can be linked to the appropriate
    class, state transition, sequence, and activity
    diagrams
  • It is much easier to repair a diagram now than to
    change the software later

42
Modeling the Functions of the System
  • The following steps evolve the requirements
    use-case model into an analysis use-case model
  • Identify, define, and document new actors.
  • Identify, define, and document new use cases.
  • Identify any reuse possibilities.
  • Refine the use-case model diagram (if necessary).
  • Document system analysis use-case narratives.
  • System analysis use case a use case that
    documents the interaction between the system user
    and the system. It is highly detailed in
    describing what is required but is free of most
    implementation details and constraints.

43
Revised System Use-Case Model Diagram
44
Use-Case Narrative
45
Use-Case Narrative (cont.)
46
Abstract Use-Case Narrative
47
Modeling Use-Case Activities
  • Activity diagram a diagram that can be used to
    graphically depict the flow of a business
    process, the steps of a use case, or the logic of
    an object behavior (method).
  • One or more activity diagram can be constructed
    for each use case (more than one if use case is
    long or contains complex logic).
  • Solid dot represents the start of the process.
  • A rounded-corner rectangle represents an
    activity or task that needs to be performed.
  • Arrows depict triggers that initiate activities.
  • A solid black bar is a synchronization bar that
    allows you to depict activities that occur in
    parallel.

48
Example of an Activity Diagram
49
Finding and Identifying the Business Objects
  • Find the Potential Objects
  • Review each use case to find nouns that
    correspond to business entities or events.
  • Select the Proposed Objects
  • Not all nouns represent business objects.
  • Ask
  • Is the candidate a synonym of another object?
  • Is the candidate outside the scope of the system?
  • Is the candidate a role without unique behavior,
    or is it an external role?
  • Is the candidate unclear or in need of focus?
  • Is the candidate an action or an attribute that
    describes another object?

50
Partial Use-Case Narrative with Nouns Highlighted
51
Potential Object List
52
Proposed Object List
53
Organizing the Objects and Identifying their
Relationships
  • Identifying Associations and Multiplicity
  • Identifying Generalization/Specialization
    Relationships
  • Identifying Aggregation Relationships
  • Prepare the Class Diagram
  • Class diagram a graphical depiction of a
    systems static object structure, showing object
    classes that the system is composed of as well as
    the relationships between those object classes.

54
Chapter Summary
  • This chapter introduces object modeling, which is
    a popular technique that describes a system in
    terms of objects
  • The Unified Modeling Language (UML) is a widely
    used method of visualizing and documenting an
    information system
  • At the end of the object modeling process, you
    organize your use cases and use case diagrams and
    create class, sequence, state transition, and
    activity diagrams
Write a Comment
User Comments (0)
About PowerShow.com