Documente Academic
Documente Profesional
Documente Cultură
Statechart diagram.
Each class may create a statechart diagram, useful for determining class methods.
18-5
Use Cases
Depiction of a systems behavior or functionality under various conditions as the system responds to requests from users Full functioning for a specific business purpose
Actors
Represent role played by one or more users Exist outside of the system May be a person, another system, a device, such as a keyboard or Web connection Can initiate an instance of a use case May interact with one or more use cases and a use case may involve one or more actors
Actors (Continued)
Actors may be divided into two groups: Primary actors supply data or receive information from the system Secondary actors help to keep the system running or provide help
Help desk, analysts, programmers, etc.
What is a Boundary?
A boundary is the dividing line between the system and its environment. Use cases are within the boundary. Actors are outside of the boundary.
Use Case
Consists of three things:
An actor (user) that initiates an event. An event that triggers a use case. The use case that performs the actions triggered by the event.
What is a Connection?
A connection is an association between an actor and a use case. Depicts a usage relationship Connection does not indicate data flow
Includes
Use case contains a behavior that is common to more than one use case. The common use case is included in other use cases. Dotted arrow points toward common use case.
Generalizes
One thing is more general than another thing. Arrow points to the general thing.
Introduction
What is a Data Flow Diagram? Why do we use DFDs? Levelling Conventions Decomposition and Abstraction The Elements Process and Data Stores Outside Entity Data Flow The Levels Rules The Procedure for Constructing DFDs The Document Flow Diagram
Levelling
DFDs are expanded or decomposed into levels. Separating each process into sub processes Uncovers more and more detail
Conventions
Balancing Process at lower level should have identical data flows if they flow out of a process Modelling Data Stores Only use DATA STORES used within this process on the diagram Numbering 1 - 1.1 - 1.1.1 1.2 - 1.2.1 Labels Should carry as much meaning as possible
The Elements
The four main elements of DFDs notation Data Flows, with a label to indicate what data is flowing Processes, that handle the data Data stores, within the system (diary, filing cabinet or computer file) Outside entities, outside sources of data
Data Stores
M1
Name of Store
Outside Entity
Is anything outside the system that is of interest to the system. Can be a person, a company or another system.
Customer a
Outside entity shows the Name and a lowercase alpha character is used to uniquely identify it.
Customer a
If an outside entity is repeated for the purpose of neat layout a line is added across the top.
Data Flow
Is shown by a line with an arrowhead, indicating the direction of the flow of data. Each data flow should be named to indicate what data is being passed. Nouns or adjectives only no verbs are permitted.
The Levels
Context - Overview - contains only one process Level 1 - Utilises all four elements Level 2 - A breakdown of a level 1 process Level 3 - A breakdown of a level 2 process There is no rule as to how many levels of DFD that can be used.
Rules
Sequence not important - getting the Process correct is
Context or Level 0 - Identifies the system/ boundary/External Links Level 1 - Overview of function Level 2 - Breakdown to Understand Hard to know where to stop Rule of Thumb If there are more than 8 data flows break it Process of Identifying major Processes
Supplier
Stock Control
Purchasing
Bill of Materials
Factory
Design
a Production Planning
Produc tion Plan
b Supplier
Delivery Note
e Design
Bill of M aterials
c Purchasing
d Factory
All data flows going into the system must be received by a process. All data flows going out of the system must be generated by process. The first task is therefore to identify these processes:
1
Stoc k c l er k M ai ntai n pl anned cal l - off
a Production Planning
Stock clerk
M1 Bill of m aterials
Maintain planned call-off
b Supplier
M2
Stock cards
c Factory
3
d Purchasing
Three models
Object model:
Static structure of objects in a system and their relationships. Contains class diagrams.
dynamic model;
describes aspects that change over time: state transition diagrams
functional model;
Use Case diagrams
Dynamic modelling
Events states state diagrams conditions operations
Events
Something that happens at a point in time
Mouse button clicked / Signal changes
Event classes
Event occurrences are grouped into event classes
Flight 123 departs from Chicago / Flight 456 departs from Rome Event class is Flight Departs
States
A state is an abstraction of the attribute values and links of an object. Sets of values are grouped together into a state according to properties that affect the gross behaviour of the object. E.G.. A bank is solvent or insolvent depending on whether its assets exceed its liabilities. A state corresponds to the interval between 2 events received by an object.
A state separates 2 events. An event separates 2 states.
Characterisations of a state
State: Alarm ringing Description: alarm on watch is ringing to indicate target time Event sequence that produces the state: set alarm (target time) any sequence not including clear alarm current time = target time
State Diagrams
Relates to a specific object Relate states and events A change of state is called a transition All transitions leaving a state must correspond to different events The transition fires An event that has no transition is ignored A sequence of events corresponds to a path through the graph
Initial/final States
The previous example is a continuous loop Most situations will have an initial and final state Chess game
White's turn checkmate Start White moves Black's turn Black moves stalemate white wins Draw Black wins
stalemate
Checkmate
Conditions
Used as guards on transitions.
A guarded transition only fires when the condition is true e.g.
When you go out in the morning (event), If the temperature is below freezing (condition). Put on your gloves (next state).
Operations
Attached to state Performed in response to the state Attached to a transition Performed in response to the event
T e e l p h o n e c a l I d e l o n h o o k o h f o o k
m i t e o u t D a i o t l n e T i m e o u t
d o S : o u n d d a i o t l n e d o s : o u n d o l u d d g i n ( t i ) d g i n ( t i ) m i t e o u t
D a i n i l g R e c o d r e d m e s n i v a d i l n u m b e r B u s y o t n e d o : P l a y m e s s a v a d i l n u m b e r d o s : o l w b u s y o t n e n u m b e b r u s y C o n n e c n i t g d o n i f : d c o n n e c o i t n r t u n k b u s y o r u e t d F a s b t u s y o t n e n i r g n i g
d o a f : s b t u s y o t n e d o n i r : g b e l m e s s a g c a e l d p h o n e a n s w e s r c / o n n e c n i l t e
C o n n e c e t d o n h o o k / d s i c o n n e c t n i l e c a e l d p h o n e h a n g s u p d / s i c o n n e c n i l t e D s i c o n n e c e t d
Class name
Attributes
May be completed during design phase Completed during the design phase
methods
Student
Course
takes
Cardinality Constraints
Zero or more
One or more
Zero or one
1..4
Explicit cardinality
Examples
All Course objects have a professor and at least 1 student In any semester a professor will teach zero or more courses Students may take up to 6 courses
Student
+
takes 0.. 6 Course
Professor 1 teaches
Examples
Student Associations read from left to right
+
takes 0.. 6
Professor 1 teaches
Course
Relationship Attributes
Employee Company + name works forfor works salary
+ name ss_num
salary
Bad salary as an attribute precludes the possibility Better model salary as a relationship attribute of an employee working for more than one company
Role Relationships
Person
name ss_num address 2
parent
child of
child
Role identifiers
Ternary Relationships
Project Programmer
assigned * +
1
Language
Aggregation
Colemans Notation
Aggregation
UML Notation
Aggregate Class
Component 1
Component 2
Component 3
Example of Aggregation
Consider the Ternary Relationship Project-Programmer-Language
Project
Language
assigned
+ * Programmer
uses
The qualifier distinguishes among the set of objects at the many end of an association
Qualification
Example
Directory * contains
File
Multiplicity can be removed by the qualifier file name which uniquely identifies a single file.
Qualification
File
area
perimeter
Circle
Rectangle
area perimeter
area
perimeter
Classes having the same attributes may be generalized to a common ancestor class
Land Vehicle
Air Vehicle
Water Vehicle
A filled triangle indicates that all objects of the parent class belong to distinct subclasses