- Cac phuong thilc cua hang hoa Cl;lth€ tu cac n6i ke't d6i tuQng: Hnh toan
G6i (Package):
G6i (Package):
MQt goi ouQc dung d~ nhom cac lOp co mQt vai cai chung l~i cung voi nhau. Trong UML, goi duQc bi~u di~n b~ng ky hi<%u:
Package I
Slf thu~n IQi cua cach tie'p c~n nay la slf dung l~i. Ne'u chung ta nhom mQt cach ciin th~n cac lOp cung voi nhau chung ta se co nhung goi ma ne'u bi hong thl chung se oQc l~p voi nhung goi khac.
Sau day lil nhom cae chuc niing hg trtj phat triin cae mo kink chink cua Rational Rose..
a). Nh6m chuc nang ve d6 hlnb
~ Goc nhln cua Use Case (Use Case View)
~ Goc nhln Logic (Logical View)
~ Goc nhln thanh to' (Component View)
~ Goc nhln tri~n khai (Deployment View)
Goc nhin Use Case co chua .. - Cac Use Case.
- Cac tac nhan.
- M6i ket hQp truy~n thong tin giua nhung Use Case va Tac nhan : M6i ket hQp truy~n thong tin mo ta stf lien h~ giua Tac nhan va User Case. Trong UML, M6i ket hQp truy~n thong tin du'Qcbi€u thi bang m(>tmui ten. D~u mui ten tren m6i ket hQp chi ngu'oi biit d~u stf truy~n thong tin. - M6i ket hQp baa g6m (include relationship - m6i ket hQp nay cho phep m(>tUse Case sa d\lng chilc mlng cling cffp bdi Use Case khac), m6i ket hQp md r(>ng(extend relationship - cho phep Use Case md r(>ngtuy y
chilc nang du'Qccling cffp bdi Use Case khac) va m6i ket hQp t6ng quat hoa (generalization relationship) giua cac Use Case.
- M6i ket hQp t6ng quat hoa giua cac tac nhan (m6i ket hQp nay dung d€
chI cae tac nhan co m(>tvai di€m chung).
- So d6 Use Case: chI ra m(>t vai Use Case, m(>t vai tac nhan trong h~
th6ng cua chung ta va nhung m6i ket hQp giua chung. M(>ttrong nhung fch lQi chinh cua nhung so d6 Use Case la stf truy~n thong tin. Nhung khach hang cua chung ta co th€ nhln vao so d6 nay va nh~n du'QCm(>t s6lu'Qng thong tin IOn.Nhln vao nhung Use Case, hQ se biet chilc nang nao se du'Qcbaa ham trong h~ th6ng. Nhln vao nhung tac nhan, hQ se biet chinh xac ai se tu'ong tac voi h~ th6ng. Nhln vao t~p cac Use Case va tac nhan, hQ se biet chinh xac d6 an thu(>cph~m vi nao. Di~u nay co th€ giup hQnh~n ra tru'oc bfft ky nhung chilc nang thieu.
Nhung so d6 Use Case dap ling m(>tm\lc tieu rieng bi~t - tu' li~u tac nhan (mQi thil bell ngoai ph~m vi h~ th6ng), Use Case (mQi thil bell trong ph~m vi h~ th6ng), va m6i ket hQp cua chung. M(>tvai di~u c~n
chu ykhi t~o so d6 Use Case:
* Khong lam mo hinh truy~n thong tin tu lac nhan de'n lac nhan. Theo dinh nghla, lac nhan la ph~m vi bell ngoai cua d~ an hit$n hanh. Do d6, slf truy~n thong tin giua cac lac nhan la bell ngoai ph~m vi ma chung ta dang Kay dlfng. Chung ta c6 th~ sa d\lng so d6 dong cong vit$c d~ khao sa t slf truy~n thong tin giua nhung lac nhan.
* Khong ve mlii ten trlfc tie'p giua .hai Use Case ngo~i tru m6i ke't hQp thong d\lng va m6i ke't md rQng . So d6 chI ra nhung Use Case nao c6
gia tri ma khong chI ra thu tlf nao ma Use Case se duQc thi hanh.
* M6i Use Case phai duQc khdi d~u b~ng mQt lac nhan. Di~u d6, nghla la lien c6 mQt mlii ten bat d~u tu mQt lac nhan va ke't thuc t~i mQt Use
?
Case. d day c6 mQtngo~i It$la m6i ke't hQpthong d\lng va m6i ke't md rQng ma chung ta da khao sat (j ph~n tren.
- So d6 tuong lac : c6 hai lo~i so d6 tuong lac la so d6 tu~n tlf va so d6 cQng lac. Ca hai so d6 tu~n tlf va so d6 cQng lac se cho chung ta thong tin gi6ng ht$tnhau, tuy nhien, c6 mQt C?Pkhac nhau giua so d6 cQng lac va so d6 tu~n tlf. So d6 tu~n tlf c6 th~ cho tha'y lieu di~m di~u khi~n, so
d6 cQng lac c6 th~ cho tha'y dong du lit$u.
- G6i: trong g6c nhin cua Use" Case, g6i la nh6m cua cac Use Case va/ho?c cac lac nhan.
G6c nhin Logic (Logical View) :
G6c nhin Logic nghien CUllht$ th6ng se cai d?t cac phuong thuc
trong cac Use Case nhu the' nao. Chung cling ca'p mQt buc tranh chi tie't cua ht$ th6ng. G6c nhin Logic baa g6m :
* Sd d6 ldp : dtiQc su dl;!ng d~ xem cac ldp trong h~ th6ng, cac thuQc inh, cac phtidng thilc va cac m6i quail h~ giua chung vdi nhau. MQt sd d6
dp cho chung ta mQtbilc tranh tInh v~ cac ldp co trong h~ th6ng, va nhung n6i k€t hQp giua chung.
M~c dinh se co mQt sd d6 ldp g9i Ia Main dtidi goc nhln Logic. Sd 16 ldp nay trlnh bay cac ldp trong mo hlnh cua chung ta.
Sd d6 ldp Ia mQt cong Cl;!thi€t k€ t6t cho nhom. Chung giup cho ngtioi khai thac d~ an tha'y va dlf ki€n ca'u truc cua h~ th6ng trtidc khi ma dtiQc vi€t, giup cho ta dam baa r~ng h~ th6ng dtiQc thi€t k€ t6t tii' ban d~u.
Ngtioi khai tri~n su dl;!ng sd d6 ldp d~ khai tri~n Idp tren thlfC t€.
Ngtioi phan tich su dl;!ngsd d6 ldp d~ cho tha'y cac chi ti€t cua h~ th6ng. Ngtioi Kay dlfng h~ th6ng cling nhln vao sd d6 ldp d~ tha'y thi€t k€ cua h~ th6ng. N€u trong mQt ldp co qua nhi~u chilc nang, ngtioi Kay dlfng h~ th6ng co th~ tha'y nhung di~u nay trong sd d6 va h9 se c~t cac chilc nang nay thanh nhi~u ldp con.
* Sd d6 ttidng lac : dtiQCsu dl;!ngd~ trlnh bay mQt dong cac slf ki~n cua cac ldp tham dlf trong mQt Use Case. MQt sd d6 ttidng lac co th~ dtiQC t(;lOtrong goc nhln cua Use Case ho~c trong goc nhln Logic. Sd d6 ttidng lac trong goc nhln cua Use Case co khuynh htidng trlnh bay cac d6i ttiQng trong khi sd d6 ttidng lac trong goc nhln Logic t~p trung tren cac ldp.
* Sd d6 chuy~n tr(;lngthai cho tha'y chu ky s6ng cua mQt d6i ttiQng tii' Iuc chung dtiQc t(;lOcho d€n khi bi huy. Sd d6 nay Ia mQt cach t6t nha't cho
tha'y phtidng thilc dQng cua mQt ldp. Trong mQt d~ an di~n hlnh, chung ta co th~ t(;lOmQt sd d6 tr(;lngthai cho m6i ldp. Tren thlfc t€, nhi~u d~ an
khong sa dl;lllg chung mQt chut nao.
Trong Rose, so d6 tr£;lngthai khong phat sinh ma ngu6n. Nhii'ng so d6 tr£;lngthai nay cling ca'p tu' 1i~u phu'ong thlic dQng cua mQt lOp d€ nhii'ng ngu'oi phat tri€n va nhii'ng ngu'oi phan tich hi€u r6 v€ phu'ong thlic thlic nay.
Tr()ng tam cua g6c nhin logic lil can true logic cua hf thong. Slf
dung l£;li1a mQt trong nhii'ng quail tam chinh d day. Chung ta co th€ nhom cac lOp l£;livdi nhau va xem xet m6i quail h~ giii'a cac lOp va cac goi, chung ta co th€ nh~n bie't cac cac lOpva cac goi co th€ dung l£;li.D€ an cua chung ta ngay cang hoan chlnh hon va chung ta co th€ them cac lOp mdi, cac goi mdi vao mQt thu' vi~n co th€ dung 1£;li.Cac d€ an sail se Kay dlfng
tren nhii'ng gl da co san hon 1a Kay dlfng m6i thli tu mQt md h6n t£;lP. H§u h€t m9i ngu'oi trong nhom sa dlJng thong tin tu goc nhln Logic,
nhu'ng nhii'ng ngu'oi sa dlJng chinh 1a nhii'ng ngu'oi pha t tri€n va nhii'ng ngu'oiKay dlfng h~ th6ng. Ngu'oi phan tich se nhln vao cac lOp va cac so d6 Wp d€ giup h9 dam baa ding cac yell c§u se du'Qccai d~t. Nhan vien dam baa cha't 1u'Qngse nhln vao cac lOp, cac goi, va cac so d6 lOp d€ tha'y cac ph§n cua h~ th6ng hi~n hii'll va c§n du'Qcki€m tra. Ngu'oi qUail 1y d€ an nhln vao cac lOp va cac so d6 d€ dam baa ding h~ th6ng du'Qcca'u truc t6t
va danh gia dQ phlic t£;lPcua h~ th6ng nhu' the' nao.
G6c nhin thanh tff (Component View) :
Trong goc nhln thanh to' chung ta t~p trung vao slf.t6 chlic v~t 1y cua h~ tn6ng. D~\l tlen chung ta Cl\l')'~tG\nn cae \d~ se G\1qct6 cnuc tnann cae
thl!c hi~n, cac t~p tin thu' vi~n lien ktt dQng (DLL), va cac t~p tin thai gian thl!c khac nhau trong h~ thO'ng.
~ Blnh nghia Thanh to' (dung trong Rational Rose) :
MQt thanh to'la mQtmodule v~t ly cua IDa.Thanh to' co thti baa g6m ca thu' vi~n ma ngue)nva cac t~p tin thai gian ch~y.
MQt khi thanh to' du'Qct~o, chung du'Qcthem vao so d6 thanh to' va
mo'i lien h~ du'Qc ve giil'a chung, du'Qc gQi la mQt ph\! thuQc. MQt ph\! thuQc d~ nghi rang thanh to' nay phai du'Qcbien dich tru'oc thanh to' kia.
~ Sd d6 thanh to' :
So de) thanh to' chI cho chung ta cach nhln v~t ly v~ ma hlnh cua chung ta. MQt so de)thanh to' chI cac thanh to' phftn m~m trong h~ thO'ngva cac mo'i quail h~ giil'a chung. Co hai lo~i thanh to' tren so de) : cac ma dun thi hanh va cac thti vi~n miL
Trong Rose m6i lOp trong ma hlnh du'Qcanh x~ dtn mQt ma ngu6n
thanh to'. Khi mQt thanh to' du'Qc t~o, chung du'Qc them vao so d6 thanh to'. Nhil'ng ph\! thuQc du'Qc ve giil'a cac thanh to', chung cho thffy cac ph\! thuQc
thai gian dich va thai gian ch~y giil'a cac thanh to'.
Cac so d6 thanh to' du'QCsa d\!ng bdi bfft cU'ai co trach nhi~m bien dich h~ thO'ng, chung se cho bitt thU'tlj cac thanh to' cftn bien dich, thai gian ch~y cac thanh to' du'Qct~o tu ktt qua cua sl! bien dich. So de)thanh to' cling cho thfty sl! anh x~ cac lOp dtn sl! cai d~t cac thanh to' va so d6 nay cling la noi ma sl! phat sinh ma du'Qcb~t dftu.
Goc nhin triin thai (Deployment View) :
?
la bO'tri m~ng va vi tri cua cac Ill;Odun tren m~ng. d day chung ta cling xem xet : chung ta co baa nhieu m~ng di~n rQng? Co baa nhieu ngu'ai su'
dlJng d6ng thai. Chung ta se lam gl nSu server hong? ...
Goc nhln tri€n khai co chua cac bQ xU'ly, cac thiSt bi va cac kSt nO'i
giii'a bQ xU'ly vdi thiSt hi. Ta't ca nhii'ng cai nay du'Qcbi€u thi tren mQt so
d6 tri€n khai. Chi co mQt so d6 tri€n khai tren mQt h~ thO'ng,do do chi co
mQt so d6 tri€n khai tren mo hlnh Rose.
So d6 tri€n khai du'Qc sU' dlJng bdi ngu'ai qUail ly d~ an, ngu'ai sU' dlJng, ngu'ai thiSt kS, va nhan vien tri€n khai, hQ hi€u du'Qc stf bO'tri v~t ly cua h~ thO'ng va noi nhii'ng h~ thO'ng con khac nhau du'Qc lu'u tru. So d6 nay
giup ngu'ai qUail ly d~ an truy~n d~t dSn ngu'ai sU'dlJng nhfi'ng gl ma h~ thO'ngmong muO'n.Chung cling giup cho nhan vien chili trach nhi~m tri€n khai len kS ho~ch tri€n khai chung.
~b6m cbuc Dang ki~m tra d6 blnb va pbat sinh ma ngu6n :
MQt trong nhfi'ngd~c tru'ng cua Rational Rose la kha nang sinh ma ttf dQngdu'Qctrlnh bay trong mo hlnh. 'Co 6 bu'dc d€ sinh ma :
1. Ki€m tra mo hlnh. 2. T~o cac thanh to'.
3. A.nhx~ cac 16p dSn cac thanh to'. 4. Cai d~t cac thuQctinh sinh ma. 5. Ltfa chQn 16p,thanh to', nhom .
c). Chuc nang chuy~n ngtidc d() hlnh (Reverse Engineering):
Chuyen nguQc d6 hinh 1ftkhii m1ng lay thong tin tit ma ngu6n va t?O
hay c~p nh~t ma hinh Rose. MQt tro"ngnhfi'ng doi hoi cua cae dS an eong ngh~ thong tin la gifi'cho ma hinh d6i tucjng phu hcjp vdi ma. Til cae yell cgu thay d6i, nguoi ta c6 th€ thay d6i ma tnjc tie'p, hODla thay d6i ma hinh va sail d6 phat sinh ma thay d6i til ma hinh. Chuy€n ngucjc d6 hinh giup chung ta gifi'ma hinh d6ng bQvdi IDa.
Trong qua trlnh chuy€n ngucjc d6 hinh, Rose se dQc cae thanh t6, nh6m, ldp, m6i ke't hcjp, thuQe Hnh va cae phuong thue tli IDa. Dung cae thong tin nay, Rose se t~o hay c~p nh~t mQt ma hinh d6i tucjng.
N~\l cn\ll\'g, \'d co IDQ\ \~~ tin IDa ng,\l~n eo enTIa ffi.Qt \~~, qua t1:\.nh
chuy€n ngucjc d6 hinh se t~o mQt lOp tuong ling trong ma hinh Rose cua chung ta. M6i thuQc tinh va phuong thuc cua lOp se xua-t hi~n nhu cac thuQc tinh va cac phuong thuc cua lOp mdi trong ma hinh Rose. Cung voi ten thuQc tinh va ten phuong thlic Rose dua vao thong tin v~ tinh tr~ng c6
th€ tha-y ducjc, ki€u dfi' li~u va gia tri m~c dinh.
Ne'u chung ta dung Rose t~o cae lOp g6e, sail d6 thay d6i ma cua cac
ldp. Nhfi'ng thay d6i nay se ducjc phan h6i trong ma hinh trong qua trinh chuy€n ngucjc d6 hinh. Ching h~n, ne'u chung ta x6a mQt phuong thuc trong IDa, phuong thlic se bi x6a kh6i ma hinh trong lue chuy€n ngucjc d6 hinh. Ne'u chung ta them mQt thuQc tinh ho~c mQt phuong thlic tnje tie'p vao trong ma thi thuQc tinh hay phuong thlic mdi nay se ducjc them vao ma hinh trong luc chuy€n ngucjc d6 hinh.
TiLi li~u tham khiio :
[1] Chirstopher Alexander, "Timeless Way of Building", Oxford University Press, 1970; " A Pattern Language", Oxford University Press, 1977.
[2] Wendy Boggs, Micheal Boggs, "Mastering UML with Rational Rose",
1999 SYBEX Inc, ISBN: 0-7821-2453-4.
[3] Peter Coad, D.North, M.Mayfield, Object Models: "Strategies, Patterns, and Applications", Prentice Hall, 1995.
[4] Martin Fowler, "Analysis Patterns, Reusable Object Models", Addison-
Wesley, 1997, ISBN: 0-201-89542-0.
[5] Erich Gamma, Richard Helm, Ralph John Vlissides, "Design Patterns:
Elements of Reusable Software Architecture", Addison-Wesley, 1995, ISBN: 0-201-63361-2.
[6] John D. McGregor, "Let Architectural Reuse Guide Component Reuse: A
Pattern for ReUse", Clemson University, Copyright @ 1996 Software Architects. All rights reserved.
[7] Kirby Mclnnis, Castek, "Component-based Design and Reuse",
http://www.cbd-hq.com/articles/1999/990715 _cbdandreuse .asp.
[8] Johannes Sametinger, "Software Engineering With Reusable Components", ISBN 3-540-62695-6.
[9] "Object-oriented Application Frameworks",
http://www .sjug. org/ ~cssheong/home/ articles/frame works .html.
[10] Petia Wohed, "Conceptual Patterns for Reuse in Information Systems
[11] GS.TS B';lch Hung Khang," Phan rich, thitt kt cai dt;ith~ thong tin
qudn if;", Vi~n Tin HQc Trung tam Hu3'n luy~n va Ung dvng Tin hQc, Ha
NQi 1990.
[12] TS. D6ng Thi Bich Thuy ,"Giao trinh mon h(Jc Phan rich thitt kt cai
dt;ith~ th(fng thong tin".
[13] Roger S.Pressman, "Ky ngh~ phdn mim" t~p 1 va 2, Ngo Trung Vi~t