Post on 28-Mar-2015
ELH 1
Entity Life Histories
• Model the system from the viewpoint of how information is changed.
– Diagrammatic representation of the life of an entity from creation to deletion
– Permitted sequence of events that can change an entity occurrence
– Part of the Entity-Event Modelling technique
• Purpose of Entity Life Histories– Analysis - to show that all the update processing and states of
entity occurrences have been considered– Design - to help in program specification– Leads to Effect Correspondence Diagrams
for each event show the correspondence between its effects on entities
used to define Update Process Models (program designs)
ELH 2
Events in the Life of an Entity
• An event causes a consistent and complete set of changes to information held in the system.
• Each occurrence of an entity will be affected by one or more events
M. Moneybags Account
Account opened
Cash Deposit £2000
Cheque Cashed £20
Direct Deposit £1000
Cheque Cashed £20
Direct Deposit £2000
P. Penniless Account
Account Opened
Pay deposit £500
Cheque Cashed £200
Cheque Cashed £300
Cheque Cashed £300
ELH 3
Sample ELH for a Bank Account
• Entity Life Histories show all the events that have an effect on an entity during its life
• Diagram is generic
i.e. valid for any account at the bank
Account Life
Account Deletion
Bank Account
Account Closure
Account Opened
Credit Debit
Balance Change
*
o o
ELH 4
EVENT
• Something that triggers a process to update system data
• May have an effect on several entities
• Matrix shows effects of events on entities
Account Opened Credit Debit
Account Closure
Cus
tom
er
Ban
k A
ccou
nt
Tra
nsac
tion
Events
Entities
C C M C M C M
Effect of event on entity is:
Creation CModification MDeletion D
Account Deletion D
ELH 5
ELH Notation
Account Life
Account Deletion
Bank Account
Account Closure
Account Opened
Credit Debit
Balance Change
*Nodes Events having an Effect on the Entity
Entity name
o o
ELH 6
Sequence
• 'A' will always be the first to occur, followed by 'B', 'C' and 'D' in that order
• No other sequence is permitted
• No indication is given of time intervals between the boxes in a sequence
A B C D
Entity X
ELH 7
• Events or nodes that are alternatives at a particular point in the entity life history
• Selection shown by a box with a circle in the top right corner
• Occurrence of entity X created by any one of three events: E, F or G
Selection
A B C D
E F G
Entity X
o oo
ELH 8
Selection (continued)
• If one of the options is “do nothing,” a 'null' box may be added:
– 'Null' box does not represent an effect or node– Indicates nothing is happening– If the 'null' is selected, the life continues directly to the next
node or event
E F G
A
o o o o
ELH 9
• Event or node may be repeated any number of times at the same point in a life
• An occurrence of the iteration must be complete before the next begins
• Shown by an asterisk in the top right hand corner of a box
• Event H may affect the entity any number of times
NB. 'Any number of times' includes zero!
Iteration
A B C D
E F G H *
Entity X
o o o
ELH 10
Parallel Structures and Quits and Resumes
• Occasionally required
• Can manage without, but useful to simplify structure
• Used in the situation where events or nodes occur in no predictable sequence
• Does not show concurrency
• Shown as a horizontal parallel bar on the ELH diagram
ELH 11
Parallel Structures
• Event 'N' may affect the entity a number of times during the sequence of K, L and M.
• Node 'I', representing the sequence, and the node 'J', representing the iteration, are shown under the parallel bar
Entity X
DA B C
F G H
I J
K L M N
*
*
E o o o
ELH 12
Diagram Without Parallel Structure
• The previous ELH can be drawn without the parallel structure
• Iteration of 'N' must be repeated several times
• Parallel Structure is probably easier to understand
Entity X
* * * *
A B J K J L J M J D
NNNNHGFE*o o o
ELH 13
Quit and Resume
• Quit from one part of an ELH to Resume in another part
• If the quit event occurs, then instead of processing the event marked with the Q, the life jumps to the quit event which is marked R
• After event B occurring, instead of the normally occurring next event C, event E can occur
• Possible event sequences are: abcbcde, ade, abe, abcbe
• Known as a disciplined conditional quit
Y
A 1 D E
2
CB
R1
Q1
*
ELH 14
Illegal Unconditional Quit
• Unconditional quit where the quit event must always be followed by the resume effect
• Different from the disciplined conditional quit shown previously
• Can always be avoided by redrawing the structure
Illegal
in SSADM
Entity X
E F
JI
HG
NMLK
A B DC
*
o o o *
ELH 15
Equivalent Diagram to SSADM Standards
• Two new nodes, P and Q, ensure that each parent node has children of only one type.
JI
K L M N
F
E G H
Entity X
B C
D
A
P
*
Q
*
o o
o o
ELH 16
Random Quits and Backward Quits
• Quit backwards (reversion) to Account Life if Account Re-opened (Q1)
• Random Quit on Customer Death to Death Structure (R2)
Account Life
Bank Account
Account Closure
Account Opened
Balance Change
Credit Debit
*
Account Deletion
Possible Re-open
Account Re-opened
Death Structure
Customer Death
Customer Deletion
Q1
R2
R1
Q2: Quit from anywhere on Customer death to R2
o
o
o
o
ELH 17
Combining the Components
• A node cannot be a “parent” to more than one type of structure.
• This structure is incorrect because:
—Node X, combines (“parents”) a selection (A and B) with a sequence (A, B, and 2)
—Node 2 combines a selection (C and 4) and an iteration (F) with a parallel structure
—Node 4 combines two iterations (D and E) with a sequence.
X
BA
F4
2
C
ED
OO
OO
*
*
*
ELH 18
Corrected Version to SSADM Standards
• Node X parents a sequence;
• Node 2 parents a parallel structure;
• Node 3 parents a selection;
• Node 4 parents a sequence;
• Nodes 5, 6, and 7 parent iterations.
X
3BA
21
65
F4C
7
ED
o
oo
o
*
**
ELH 19
Effect Qualifiers (Optional Effects)
• Where one event can affect an entity occurrence in two or more ways
• Effect Qualifiers (shown in brackets) distinguish between two different effects of the same event (Debit)
e.g. The event “Debit” will have different processing if account is overdrawn rather than in credit
Account Life
Account Deletion
Bank Account
Account Closure
Account Opened
Credit Debit
Balance Change
*
Debit (account overdrawn)
(account in Debit
credit)
Optional Effects
ELH 20
Entity Roles (Simultaneous Effects)
• When one event occurrence affects more than one entity occurrence (of the same type) in different ways
E.g. a Bank Account may be closed by transfer to another account
• One event occurrence “Transfer”, two entity occurrences affected
– account being closed and account being opened
• Simultaneous effects of one event shown by role names in [square brackets]
Account Life
Account Deletion
Bank Account
Account Closure
Account Opened
Cheque or Cash Credit
Transfer [New Account]
Transfer [Closed Account]
Final Withdrawal
o o o o
Entity Roles
ELH 21
Operations
• Operations added to Entity Life Histories
• Operations show the processing performed on the data
• Each operation must change an attribute value in the entity occurrence or a relationship occurrence
• Operations follow a specified syntax (considered later)
• Operations identified by number in small square box attached to entity
• Operations list shown beside Entity Life History
Bank Accoun
t
Account Opene
d
Account Life
Account Closure
Account
Deletion
Balance Change
*
Credito
Debito
Operations List
4. Replace Balance using Balance + Credit Amount
5. Replace Balance usingBalance - Debit Amount
1. Store Keys 2. Store remaining attributes
3. Gain Transaction
6. Store Date Closed
3 4 3 5
1 2 6