StateModel Design 1 Data Stucture Diagram DSDEERD - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

StateModel Design 1 Data Stucture Diagram DSDEERD

Description:

... tables TT and TA have the same format as ordinary tables described by instances of TT and TA. ... TR000001 ST000001 ST000002 /* enabled by set event ... – PowerPoint PPT presentation

Number of Views:116
Avg rating:3.0/5.0
Slides: 8
Provided by: robertl8
Category:

less

Transcript and Presenter's Notes

Title: StateModel Design 1 Data Stucture Diagram DSDEERD


1
StateModel Design - 1Data Stucture Diagram
(DSD/EERD)
SchemaVersion SV SchemaName VersionNo LastModAutho
r LastModDate
FuncPtr Array (LCP-declared
link-time-updated index initialized in ST)
StateModel SM abbrev name SMdescription
(Enter non-key attributes only primary and
foreign keys are implicit)
FuncTable FT (Action Routine)___
ARname ARdescription ARptr index to FPArray
State ST stateName ARname ARptr (FPindex)
STdescription
(Source Target ACid)
EventType ET label ETdescription
(Mutex Alt sequence via child_loop)
TBD Event Type Signatures
Transition TR EventLabel TRdescription
StateFunction SF
Enable EN
Each table must have a unique two-letter
abbreviation ttabbr SchemaVersion SV
StateModel SM STate ST TRansition TR
EventType ET ENable EN FunctionTable FT
StateFunction SF. Each TTabbrev produces a
primary key (pkey) attribute SV -gtSVid SM -gt
SMid ST -gt STid TR -gt TRid ET -gtETid EN -gt
ENid FT -gt FTid SF -gt SFid. Each 1M
relationship produces a foreign key
(fkey) SV---gtSM gt ST.SMid ST--gtTR gt TRSTid1
TRSTid2 ET---gtEN gt EN.ETid TR--gtEN gt
EN.TRid SM---gtFT gt FT.SMid ST--gtSF gt
SF.STid FT---gtSF gt SF.Tid. Attribute formats
and descriptions must also be acquired When
these are added, file StateModel.sch comprises a
Data Dictionary of entities, classes,
relations and attributes.
2
StateModel Design 2StateModel.sch File
  • SchemaVersion SV / schema version containing
    this state mode /
  • / SV Attributes name, versionNo,
    lastModAuthor, lasModDate/
  • StateModel SM / State Model for one Active
    Class ( TT000001 SM) /
  • SMid NA c8 1 / pkey of this State Model
    /
  • SVid NA c8 1 / fkey of Schema Version /
  • Abbrev NA i4 0 / ttabbrev of Modeled Object?
    /
  • Name NA t80 0 / Full Name or Description of
    SM /
  • State ST / One state or stage of behavior
    ( TT000002 ST) /
  • STid NA c8 1 / pkey of this STat e /
  • SMid NA c8 1 / fkey of parent State
    Model /
  • STname NA c32 0 / a name to identify this
    state /
  • ARname NA c8 0 / Action Routine Name /
  • ARptr NA i4 0 / Was pointer, now integer
    index since 04s522) /
  • Descrip NA t80 0 / Full Name or Description of
    State /

3
StateModel Design - 3With ST to FP M to N
Relation
  • SchemaVersion SV / schema version which contains
    this state model model /
  • / contents not shown, for brevity name,
    versionNo, lastModAuthor, lasModDate/
  • StateModel SM / State Model for one Active
    Class (-gt TT000001 SM) /
  • SMid NA c8 1 / pkey of this State Model /
  • SVid NA c8 1 / fkey of Schema Version /
  • Abbrev NA c4 0 / ttabbrev of Modeled Object?
    /
  • Name NA t80 0 / Full Name or Description of SM
    /
  • State ST / One state or stage of behavior
    ( -gt TT000002 ST) /
  • STid NA c8 1 / pkey of this STat e /
  • SMid NA c8 1 / fkey of parent State Model /
  • STname NA c32 0 / a name to identify this
    state /
  • ARname NA c8 0 / Action Routine Name /
  • / ARptr NA i4 0 (not needed child_loop from
    ST to SF gets FTid sequence) /
  • Descrip NA t80 0 / Full Name or Description of
    State /

4
StateModel Design - 4 bde2sch Conversion
EERDfile.dat from BDE
BDE
BDE
b2t
t2b
(Desired input to chgen TBD get s2t out of
chgen.)
TTTA.msdat
t2s
chgen
(Current input to chgen)
EERDfile.sch
since v11, chgen meta EERDfile.sch does s2t
5
StateModel Design - 5 Schema Tables TT and TA
(Schema as stored in tables TT and TA for
brevity, the attributes of tables FT, SF and SV
are not shown)
TableTypes TT / holds description of each table
type /
PKey TTabb TableName Description TT00000
1 SM StateModel / Model for one Active
Class / TT000002 ST
State / Behavior of this state /
TT000003 TR Transition / Transition STid1 to
STid2 / TT000004 ET EventType / Table
of Event Types /
TT000005 EN EventEnable / associates etent
with transition / TT000007
FT FunctionTable / Table of Acton Routine
Functions / TR000008 SF StateFunction /
asssociates State with its Action / TT000009
SV SchemaVersion / identifies schema and
tracks changes/

TT.TAid_fcp for row 1 of table TT
TableAttributes TA / holds definition of each
attribute /
TAid(Pkey) TTid(parent) Name Alt type is_key
Description TA000001 TT000001 SMid NA
c8 1 / pkey of this State Model /
TA000002 TT000001 Abbrev NA c4 0 / ttabbrev of
Modeled Object? / TA000003 TT000001 Name
NA t80 0 / Full Name or Description of SM /
TA000004 TT000002 STid NA c8 1 / pkey of this
STat e / TA000005 TT000002 SMid NA c8 1 / fkey
of parent State Model/ TA000006 TT000002 ActName
NA c8 0 / Action Routine Name /
TA000007 TT000002 ActFunc NA c8 0 / Action
Routine Function pointer/ TA000008 TT000002 Name
NA t80 0 / Full Name or Description of State/
TA000009 TT000003 TRid NA c8 1 / pkey of this
State Transition/ TA000010 TT000003 STid1 NA c8
1 / Transition Source or 'From' State /
TA000011 TT000003 STid2 NA c8 1 / Transition
Destination or 'To' STate/ TA000012 TT000004 ETid
NA c8 1 / pkey of Event Type
/ TA000013 TT000004 SMid NA c8 1 / State
Model Receiving this ET / TA000014 TT000004 Lab
el NA c32 0 / State Transition label
/ TA000015 TT000004 Descrip NA t80 0 /
Event Type description/ TA000016 TT000005 ENid N
A c8 1 / pkey of ENable relation (ET to TR)/
TA000017 TT000005 ETid NA c8 1 / fkey to Event
Type / TA000018 TT000005 TRid NA c8 1 / fkey
of enabled State Transition/ . . . (attribs of
tables FT, SF and SV) . . .
TT.TAid_fcp for row 5 of table TT
Note that metadata tables TT and TA have the same
format as ordinary tables described by
instances of TT and TA. Therefore, metatables TT
and TA can also be defined and stored
in two rows of TT and eleven rows of TA.

6
StateModel Design - 6Two-State SM Example
State Model Name TSTwo-State
ET01TSSet
TSS0OFF no-op
TSS1ON no-op
ET02TSReset
This state model has two states, two
transitions, and two event types. Each state has
one incoming transition, one outgoing transition,
and one ActionRoutine named no-op, which is
executed on entry to either state.
  • This Diagram can be stored in a SMStateModel.dat
    file
  • File SMStateModel.dat can be generated two ways
  • From string constant declarations in a LCP API
    code file.
  • From bde2SM (.bde to .dat file converter)
    (TBUpdated)

7
StateModel Design - 7(Two-State Model Conversion
to a SM.dat File)
SchemaVersion table entry omitted
EventType.Label field syntax restructured as in
the revised ChkgAcct.ppt case study. (Generate
this file from ST, TR and ET declared as strings.)
State Model Name TSTwo-State
ET01TSSet
TSS0OFF no-op
TSS1ON no-op
ET02TSReset
bde2sch
TwoStateSM.bde
BDE
TwoStateSM.sch
SV000001 TS TwoState / equiv. to an RS
Flipflop / /-------------------- (comment lines
are ignored by pr_load) ----------------/ ST00000
1 SM000001 TSS0Off no-op / Initial
stateoutput0 / ST000002 SM000001 TSS1On
no-op / Alternate stateoutput1/ /-----------
--------------------------------------------------
------------------------------/ TR000001
ST000001 ST000002 / enabled by set event
/ TR000002 ST000002 ST000001 / enabled by
reset event / /-------------------------------
--------------------------------------------------
----------/ ET000001 SM000001 ET01TSSet /
causes ON-to-OFF TR / ET000002 SM000001
ET02TSReset / causes OFF-to-ON TR
/ /---------------------------------------------
----------------------------------------------/ E
N000001 ET000001 TR000001 / TSset enables TR1
ST1-gtST2 / EN000002 ET000002 TR000002 /
TSReset enables TR2 ST2-gtST1 /
Write a Comment
User Comments (0)
About PowerShow.com