Requirements, Specifications, and Design Using UML - PowerPoint PPT Presentation

1 / 106
About This Presentation
Title:

Requirements, Specifications, and Design Using UML

Description:

... the same class have the same characteristics, although their attributes may have ... knobs and hardware to interface to the digital parts of the system ... – PowerPoint PPT presentation

Number of Views:50
Avg rating:3.0/5.0
Slides: 107
Provided by: Ban101
Category:

less

Transcript and Presenter's Notes

Title: Requirements, Specifications, and Design Using UML


1
Requirements, Specifications, and Design Using UML
2
Object
  • Principal component of an object- oriented
    design
  • Includes a set of attributes that define its
    internal state

3
An Object is Identified in Two Ways
  • By a unique name
  • As a member of a class

4
(No Transcript)
5
(No Transcript)
6
Class
  • A form of type definition
  • all objects derived from the same class have the
    same characteristics, although their attributes
    may have different values
  • Defines
  • the attributes that an object may have
  • the operations that determine how the object
    interacts with the rest of the world

7
Class Definition
  • Defines both the interface for a particular type
    of object and that objects implementation
  • can only read or modify the objects state
    through the operations
  • these define the interface to the object

8
Interfaces
  • Choice of an interface
  • proper interface must provide ways to access the
    objects state as well as ways to update the
    state
  • need to make the objects interface general
    enough so that we can make full use of its
    capabilities

9
Relationships
  • Association occurs between classes that
    communicate with each other but have no
    ownership relationship between them
  • Aggregation describes a complex class made of
    smaller classes
  • Composition a type of aggregation in which the
    owner does not allow access to the component
    classes
  • Generalization allows defining one class in
    terms of another

10
Derived Classes
  • Define one class in terms of another
  • e.g. - derive two particular types of displays
  • BW_display
  • Color-map-display

11
(No Transcript)
12
Derived Classes
  • A derived class inherits all the attributes and
    operations from its base class
  • relation is transitive
  • if Display were derived from another class, both
    BW-display and Color-map- display would inherit
    all the attributes and operations of Displays
    base class as well

13
Inheritance
  • One form of generalization
  • UML also allows us to define multiple
    inheritance, in which a class is derived from
    more than one base class

14
(No Transcript)
15
Link
  • Describes a relationship between objects
  • Association is to link as class is to object

16
(No Transcript)
17
(No Transcript)
18
Behavioral Description
19
State Machine
  • One method of specifying the behavior of a system

20
(No Transcript)
21
Events
  • Trigger state transitions
  • Types
  • signal event - an asynchronous
    occurrence
  • defined in UML by an object that is labeled as a
    signal
  • object in the diagram serves as a declaration of
    the events existence
  • because it is an object, a signal may have
    parameters that are passed to the signals
    receiver

22
(No Transcript)
23
Events - continued
  • call event - follows the model of a procedure
    call in a programming language
  • time-out event causes the machine to leave a
    state after a certain amount of time
  • a time-out is generally implemented with an
    external timer

24
(No Transcript)
25
(No Transcript)
26
(No Transcript)
27
Example
  • Display Operation

28
(No Transcript)
29
Sequence Diagram
  • Designed to show a particular scenario or choice
    of events
  • Display example -- the sequence shows what
    happens when a mouse click is on the menu region

30
(No Transcript)
31
Home Security Example
32
Problem Statement
  • This home security system guards against
    break-ins, fire, HVAC failure, and allows
    single-button medical, fire, and police emergency
    calls
  • Develop system requirements, specification, and a
    preliminary design

33
Requirements/Specifications?
34
Wolfs Specification Example Partial
Specification for a Model Train Controller
  • Problem Statement capability to smoothly
    control speed and direction of multiple trains
    including an emergency stop control

35
(No Transcript)
36
Analysis
  • User Interface - Control Console
  • Controls
  • throttle
  • emergency stop
  • direction
  • train selection

37
Analysis - continued
  • Power Supply constant dc voltage
  • Train Motor a dc motor
  • speed f(voltage)
  • ? pulse width modulation of the dc voltage
  • Signaling
  • console -- transmitter
  • train -- receiver
  • ?use modulation on the dc voltage

38
(No Transcript)
39
Requirements
  • Control 1 - 8 trains
  • Speed resolution 63 non zero increments in both
    directions
  • Controller desire smooth control
  • analysis ? need for an inertia constant
  • inertia f(mass) f(cars, load, etc)
  • need at least 8 different levels
  • make a user input

40
Requirements - continued
  • Emergency stop
  • ECC only need error detection

41
Requirements Summary Form
  • Name Model Train Controller
  • Purpose control speed and direction of up to
    eight trains
  • Inputs throttle, inertia setting, emergency
    stop, train number
  • Outputs train signals

42
Requirements Summary Form continued
  • Functions set engine direction and speed based
    on inertia setting, respond to emergency stop
  • Performance update train speed at least 10
    times per second
  • Manufacturing cost lt 50
  • Power lt10W
  • Physical size and weight size of standard
    keyboard, weigh less than 2 pounds

43
Develop Specifications
44
First Step
  • Basis of operation control panel sends
    messages/commands to train controller
  • COMMANDS PARAMETERS
  • Set-speed speedinteger
  • Set-inertia Inertia positive integer
  • E-stop none

45
Second Step
  • Identify objects
  • Console
  • Train_rcvr aka Receiver
  • Develop sequence diagram

46
(No Transcript)
47
  • Note - both Console and Train_rcvr (receiver)
    run continuously

48
Model for Commands
  • UML base class and derived classes
  • ? a class diagram

49
(No Transcript)
50
Why a Base Class?
  • Common features
  • header, ECC, train address, etc.

51
Model for Control Console and Train Receiver
52
(No Transcript)
53
  • Note - track is an object but not necessary to
    model unless track failure is a requirement

54
Next Step
  • Refine console and receiver

55
Console Functions
  • Read state of front panel
  • Format messages
  • Transmit messages

56
Receiver Functions
  • Receive messages
  • Interpret messages
  • Control motor speed and direction

57
  • Use CLASS DIAGRAMS to model these functions

58
For the Console
  • The Panel class
  • describes the consoles front panel
  • contains the analog knobs and hardware to
    interface to the digital parts of
    the system
  • The Formatter class
  • includes behaviors that know how to read the
    panel knobs and creates a bit stream for the
    required message

59
For the Console - continued
  • The Transmitter class
  • contains analog electronics to send the message
    along the track
  • Knobs
  • describes the actual analog knobs, buttons, and
    levers on the control panel
  • Sender
  • describes the analog electronics that send bits
    along the track

60
(No Transcript)
61
For the Train/Receiver
  • The Receiver class
  • knows how to turn the analog signals on the
    track into digital form
  • The Controller class
  • includes behaviors that interpret the commands
    and figures out how to control the motor

62
For the Train/Receiver - continued
  • The Motor Interface class
  • defines how to generate the analog signals
    required to control the motor
  • The Detector
  • detects analog signals on the track and converts
    them into digital form
  • Pulser
  • turns digital commands into the analog signals
    required to control the motor speed

63
(No Transcript)
64
Next Step
  • Refine specification to a complete formal
    specification
  • In the text, only a partial refinement is
    presented

65
  • First, refine analog components
  • knobs, pulser, sender, detector

66
Knobs
  • Four physical devices
  • Three knobs
  • Train number
  • Speed
  • Inertial Constant
  • One button
  • E-stop

67
(No Transcript)
68
  • set-knobs() -- behavior (method, operation) to
    set parameters to current train
  • when train number setting is changed
  • must reset the other controls to the proper
    values for that train
  • so that the previous trains control settings are
    not used to change the current trains settings

69
Motor Speed and Direction Control
  • Direction f(voltage polarity)
  • Speed f(average voltage level)

70
(No Transcript)
71
(No Transcript)
72
(No Transcript)
73
(No Transcript)
74
(No Transcript)
75
(No Transcript)
76
  • Note - still need to refine
  • Panel, Formatter, and Transmitter as
    remaining classes of Console
  • Motor Interface, Receiver and Controller as
    classes of Train

77
(No Transcript)
78
For the Panel
  • A behavior for each of the controls
  • new-settings() -- uses set-knobs() of knobs
    class to change settings

79
(No Transcript)
80
For the Motor
  • Sign of speed determines direction

81
(No Transcript)
82
(No Transcript)
83
For the Transmitter
  • Need behavior for each type of message that can
    be sent

84
(No Transcript)
85
For the Receiver
  • Need
  • read-command behavior to read message from
    the tracks
  • internal variable to hold current command
  • internal variable to indicate if command is a
    new behavior
  • to determine command is new
  • to determine type and parameters of command

86
(No Transcript)
87
(No Transcript)
88
(No Transcript)
89
For the Formatter Class
  • Holds current settings for all trains
  • Need behaviors
  • Sendcommand ? transmitter interface
  • Operate ? basic functions of class will
    need further refinement
  • Panel active ? indicate when panel
    parameters change

90
(No Transcript)
91
Formatter Dynamic Behavior
  • Use a sequence diagram to illustrate the role of
    the formatter during the panels operation

92
(No Transcript)
93
Refine Operate Behavior
  • Use a state diagram for first specification of
    the operate behavior of the formatter class
  • watches the panel for activity
  • if the train number changes, it updates the
    panel display
  • otherwise it causes the required message to be
    sent

94
(No Transcript)
95
Refinement of Panel-active Behavior
  • Again - use state diagram

96
(No Transcript)
97
Refinement of Train Controller Class
98
(No Transcript)
99
(No Transcript)
100
For the Operate Behavior
  • Use state diagram
  • operate behavior is called by the receiver when
    it gets a new command
  • operate looks at the contents of the message and
    uses the issue-command behavior to change the
    speed, direction and inertia settings as
    necessary

101
(No Transcript)
102
  • Controllers operate behavior must execute
    several behaviors to determine the nature of the
    message
  • once the speed command has been parsed, it must
    send a sequence of commands to the motor to
    smoothly change the trains speed

103
(No Transcript)
104
Class Update
  • Need to specify the basic features of messages
    for compatibility
  • First - need to specify the number of bits used
    to determine the message type
  • Choose three bits, since that gives us five
    unused message codes

105
Class Update - continued
  • Second - need to include information about the
    length of the data fields, which is determined
    by the resolution for speeds and inertia set by
    the requirements
  • Third - need to specify the error correction
    mechanism choose to use a single-parity bit

106
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com