Data Modeling
I I ~I
II II
!
290 Part Two Systems Analysis Methods
, " ',," -',-
fA au ... 8·5 Fundal)1$ntalEhtities fCir the SoundStage Project
Our SoundStage management and users initially identified the entities listed in Table 8-5. Notice how the definitions contribute to establishing the vocabulary of the system.
> The Context Data Model
The next task in data modeling is to construct the context data modeL The context data model should include the fundamental business entities that were previously discovered as well as their natural relationships.
Relationships should be named with verb phrases that, when combined with the entity names, form simple business sentences or assertions. Some CASE tools, such as System Architect, let you name the relationships in both directions. Otherwise, always name the relationship from parent to child.
We have completed this task in Figure 8-13. This figure represents a data model created in System Architect Once we begin mapping attributes, new entities and rela- tionships may surface. The numbers below reference the same numbers in Figure 8-13. The ERD communicates the following:
o An AGREEMENT binds one or more MEMBERS. While relationships may be named in only one direction (parent to child), the other direction is implicit. For example, it is implicit that a MEMBER is bound to one and only one AGREEMENT.
€) A MEMBER has conducted zero, one, or more TRANSACTIONS. Implicitly, a given TRANSACfION was conducted by one and only one MEMBER.
€) A MEMBER ORDER is...J! TRANSACfrON. In fact, a given MEMBER ORDER may correspond to many TRANSACfIONS (for example, a new member order, a canceled member order, a changed member order, etc.). But a given TRANSACfrON mayor may not represent a MEMBER ORDER.
o A PROMOTION features one or more PRODUCTS. Implicitly, a PRODUCT is featured in zero, one, or more PROMOTIONS. For example, a CD that appeals to both
,
I i ! i ! l I
I I !
I
(MEMBER ORDER
sells v I f - - - . ~a _ e ... --_ .. _ .. - --- ---_. - - - - ---- - - ---- --,
0 -'L 0 0 fesponds Ie
'- . - pl. c,"
fPRODUCT gener<3tes Sf.
0 binds
o 0 -
(1)> PROMOTION features. ~ ~ f,--AG_R_EE_M_EN_T ___ ~]
$'?IIi"!,ISt'ge COl'lt.exl Oa\aModel ..
'0 EMBER ORDER is a
r--------------~-u-'----------_;~;r~:~v~~'-'--W-K-,-J---------i!l ~~~.----------.------------~~¥~-------.---------~
MEMBER DoueT
e places c ___
&aIda&:
0 ReDUCT
Primary Key generales
Product·Number {PK1J
is reatured as
00 features ROMOTION
'~~~%~~~;nIf~~:3~e---~~~~ __ +rtpnma~Key,--------------" ~ Promotion-Number IPK1]
... _--_._. __ ._-_._---.-.-.
responds 0- to (MEMBER
. - - -- - - -- 11 Prima'YKaY'-------Hf ______ , Member-Number lPK.11 has,
.. -- - - - - -11 conducted :
f ,
binds o RAfolSACTION Prim"" Key---____ _
o AGREEMENT Primary Kay---------i
\Agreement-NUmber [PKll
Tfansactlon-Reference-Number [PK11
.,----;----,-
I I I
~~
[MEMBER DUCT
~ '-HumP« IPKtl~ ProOu • \PI<2}
sold 8lI
0 -- -- -- -- t-- -- . --. -,
I=I:QOUCT I PrimBfY~Y
Producl-l\lumt>er if'Kl)
..L •• •• J MERCHANDISE Tm.e -Pri"naJY Key -PrimsryKey PfOO.Jc:I-fIIUfIlbar IPK1) [ff(j Product-Number IPK1) [FK)
f) -;;
""
1" ;$& AUDlOTmE VIDEO TITLE -f'rim:lly l<i'IJ -Primary K~,. ProdUd.-Numbor IPK1) tFKj Product-Numbor [PK1J (FK)
,. ~~MaER O~DER Pri.'T!8ryKey
"l0rder-NumIwr. [PK1)
>t- o ,
.- - -
-_ .. - .-. _.- . . ...• -- ,
'- --
'''1 GAME TiTlE -PrimafY Key PIOdtICI·Numl)er lPK1) IFKJ
Hf •• ~ - -- --- -- - - --- -. --- -- ----- ---- ------------ -------, - - -- ------ - - - - --- ----.
=""'" "
, , ~ .. ,
. ~l~C~£ _________ n IMEMIlffi 1 --, ,. PrimaryKG)' I'f----------
MRmber-Nl..(j\ber (PK1j -,
-'\'< ,
~,," RANSA Primary , Tran~
K."------- ~
AGRI!EMENT Primary Key
.. - Agreemanl-NumtH!r (PKll
9C'flerale' 'ftMonoN 1 . - - - - - - - - - . - - - - - - - - - - -0 Primsry Key PromOl~umber (PK1) I e
is featured as
~~ , Pr" Key laalures , otiaf\.Nvmb«~ , 1'l"od.J~[PK2I
I , ,
I l---f)---- __ . __ -- -- -' -. --'
....... -._-, _ ..
- Data Modeling and Analysis Chapter Eight
,.-,,~ .'" .. ;::';;,!;: [<G------ - .. -" - - - - - - - - . ---._----------,
I I I 1
,~
"'.~ ~;_r[PK'1 r.:::::~ Nol\'IIO)'J'IIII , Morn_orna
"",bo,·Slo'"
"'P<'M< ~=~ ~'-r;'~ ~~~" ~ ___ '0. ---II
Ml<I\b~ _-SIola _or-Zip-Co,,"
fIo'!II>t<.()oyllmo-PhcnooNumDor
"!~'. ...... W'O'lo-o!-U.l00<d ..
[FK[ ombot-eolanoHjUO _~.c.,,,,"~ype
101_...eood~.card-t>l,,,,,b.r
)0- .- ~raj,.c..,<I.eq,ir .. o.o.
- -- .. -\ oI)onu."'.I ....... ....,.'lObi • , _ .. .cole!,iory-l'fofo"nco '0111 •• ~~!D-/.I"'ia.p,"r.,.",,'
,~"'.~" ,.~
EXp .. fcn.OoIo Gamo-C.I09Q1Y-P ....... "".
~==':.:;::~=0<1 ~~:~2;~::
':' l\g_onc.tl"~ .. p:KI P,,,"cy.codo -- -- - ._- .- -- -- -- ----- ~ Em;.1-Adil< ... , _. -1
E"''':. , I - '"'' l' ,
,. I '- - -~~~
,. , ,
I "'
., I .l, ,
I','." ;
" i Q,n.,.l ..
, --~.,"'" I "".~.""",, '"'''''' i
" I~=:" I i.t .. M ..... , 'o •• ·.,~ I
I '-- T ! ~ r
~ ". ,,·1 '" J "~~,O_'~':- IV~~~\Jl~~~ ~'m~
I I ,
.,~""" . t~""" ."""" ,
~~;'''"' 1=:,- ~ .... "". I " i _; ...... od'o-Coo. Co"lON4\~Codo I=~::~ •.
I I I
.An attribute's domain should not be based on logic. For example, in the SoundStage case we learned that the values of MEDIA were dependent on the type of product. If the product type is a video, the media could be VHS tape, Smm tape, laserdisc, or DVD. If the product type is 'audio, the media could be cassette tape, CD) or MD. The best solution would be to assign separate attributes to each domain: AUDIO MEDlA and VIDEO MEDIA.
Figure 8-16 provides the mapping of data attributes to entities for the definition phase of our SoundStage systems project. While the fully attributed model identifies all
,
, , ,
~. , <0""" .....
1- - - - .. . - "
~ ~ !~=~~ ~~"di"'-Ro!'''fI<e.N
....IW(M"bul • 1' ..... cll .... OOlo " ...... <lIo<>-TI'IIO ".'I01~!po;on
~~"'o<Ii_.\O\! p.=!.;:::-~!~Kl
I\(;~E"ENl"
Prinwy~
Ag • ..,...ono-N"""'" '''<', ..... K·tAlllil>ut • .oq, .. moot-EOIII'o-(I01
···Il" Ag'..,....I ........ "'O .: Fvllllimo-ol-P_ ~1"'<l~umb., ... I.C
, 'r IPK""
f:::::::.; ,
F"_w,"
J """ ..
297
:i
I
r '" Io\€RGKN<D<SE -~ ...... .,Ko", ____ II p'''''"« ............ tPK1llf><1 -f'too1.fWrNWolM.--- 1.10«1\<. ... ; ...... "'" ..... "'_..0_,"'" kI ... h'M ...... Typo
U""""I ...... "'.
., I\VOIQnRE .PM>o"'K<y-_____ 1I p,_""""·~ .. IP.mlFl<;1 '~'Y"""""-'tO, --'-'--' __ II ,~,
~I~O<'J' ".II<>.$~t-e: ... .".'Y H".nb<o-or ...... f!OoIo-l'."' ••• A"_ • ......:,.,. C..nl.~ ..... oq.C"".
""" ·Prl""'"OC:., ____ _ P"" ... '-"N""'''r_~~~'IIFl<l .-.... '"""---- ~;oso.(:"""
..... ~.() .. «'I""'" e.v. ... M-tI ... fnl .... ,M\OtO.C "og.,), e ....... ~ .....
i
'IIOEQnn£
~~"~~-ccccc--11 ""' .. ,1"""'_1<">1;\\1""'1 -tlOo.<lrj_
PI_ ...
~.- 1IId4e.e ..... !'/ w __
Qo.t.I.c ..........
""'"~ R_ .. ~rl!M "' ... o .... ..-.·TI'1'" "'I~","", ..
$< ... ""''''''"'' 1,I!' ... .lf~.eod4
: P"'_' ,--------.~-----------------------------
.. ! ............
~=,
'P""''Y ~."' -:--c:--II p~_"_ tP"'II'~1 .N.r>tloy~. __ _
....... ldOlt<
Go .... .c.It .. " ~.&~,!o;O'I'/ G'lmo-l"!o~""" ~~; .. l,.". _.<.oI-Pl,y." ""0/Il .... .:.1<...,.c..,.
, (j)
i ______________ , _,_ .J
:---'i-'--"---