BQ GIAo Ol,JC vA £>Ao TAO £>AIHOC QUaC GIA TP HO CHI MINH TRUONG £>AI HOC KH9A HOC TV NHIEN I NGUYEN LAM KIM THY ? , , ,.!'" KHAO SAT CACH TIEP C~N COMPONENT (PATTERNS~ - , FRAMEWORKS) DE UNG D{)NGTRONG LINH vTjc PHAN TICH THIET KE Hit THONG THONG TIN LuANAN THACSI KHOAHOC CHUYEN NGANH TIN HOC MA SO:1.01.10 r - l NGUOI HUaNG , ;:; "oJ KHOA H( ? TS DONG THT BICH THUY TP He CHi MINH - 2001 Moe loe *** Chu'dng1 D~nnh~p trang Chu'dng KHAO SAT cAcH TIEP CAN THANH TO trang 2.1 Thanh to trang 2.2 M~u trang 11 M~uthietke trang 12 ' M~u phan tfeh trang 18 : """""'" 2.3 Khung m~u trang 22 2.4 NhG'ngdi;iedi~m eua cae khai ni~m each tiep e~n to' trang 24 NhG'ngdi~m khae giG'am~u thiet ke va khung m~u trang 24 NhG'ngdi~m khae giG'am~u to va khung m~u trang 25 2.5 Nh~n xet ket 1u~n trang 25 Chu'dng UNG D1)NG CACH TIEP cAN THANH TO TRONG PHAN TICH, THIET KE H~ THONG THONG TIN: THU.NGHI~M val H~ THONG QUAN LY cAc GIAO D~CHDA.T TRVac (GIU CHO) trang 29 3.1 MQt so each tiep e~n truy~n thong d~ phan rich, thiet ke mQt h~ thong thong tin :: 3.2 Xay dtjng h~ thong thong tin rhea each tiep e~n to 3.2.1 Ph~m vi ling dl,ll1geua h~ thong qmln 1y cae giao diet di;it tru'oe trang 29 trang 31 trang 32 3.2.2 Xay dtjng m~u phan tich giai do~n phan tfeh h~ thong qmln 1y cae giao diet di;ittru'oe 3.2.3 Thiet ke h~ thong qUail 1y de giao diet di;ittru'oe trang 33 trang 38 3.3 Xay dtjng mQt ling dl,ll1ge1;lth~, b~ng each dung 1~i h~ thong quan1y cae giao diet di;ittru'ck trang 47 3.3.1 H~ thong di;itmu'c;insaeh eua thu' vi~n trang 47 3.3.2 Cae ling d1;lng khae trang 50 3.4 Ket 1u~n trang 54 Chuang CAI BAT MOT KHUNG MAU CHO H~ THONG QUAN LY CA.C GIAO DTCHBAT TRUaC : 4.1 Cai d~t mQt khung mall eho h~ th6ng quan 1y cae giao dieh d~t truck trang 55 trang 56 4.1.1 Phan tieh yell du eua h~ th6ng trang 59 4.1.2 Phan tich h~ th6ng trang 65 4.1.3 Thie't ke' h~ th6ng trang 67 4.2 Xay dlfng mQt ling dl;lng el;lth~ bang each dung l~i khung mall "q1gd.md1" trang 72 Chuang BA.NH GIA.KET QUA THljC HI~N VA HUaNG PHA TRIEN trang 74 T 5.1 Danh gia ke't qua thlfe hi~n : trang 74 5.2 Huang phat tri~n trang 80 Phl;lll;le A trang 83 Phl;lll;le B Tai 1i~u thalli khao : trang 94 trang 103 Trang Chtidng DANNH~P Khoa hQc cang phat tritin chinh la nha d~c ditim thlia huang l~i nhG'ngthanh qua cua the' h~ trudc d6, cac the' h~ trudc da "di truy~n" cho chau nhG'ng d~c tinh u'u vi~t cua mlnh VI v~y phan tkh mQt h~ thO'ng rhea hudng dO'i tuQng chung ta luon dling tren quail ditim : sa dl;lng lq,inhilng gi dii co tli trudc d6, cua chinh mlnh hay mQt d6 da t~o va khong phai l~p l~i nhung gl da lam, chung ta se c6 nhi~u thai gian cho stj sang t~o, thie't ke' nhG'ng chudng trlnh phlic t~p mang tinh hi~u qua cao Di doi vdi vi~c phan tkh mQt h~ thO'ngrhea hudng dO'ituQng d6 la thie'tke' mQt h~ thO'ngrhea hudng d6i tuQng, vdi slf baa ham bell mQt ldp dO'i tuQng la nhG'ng thuQc tinh, phudng thlic va slf ki~n ma nhung chuyen gia l~p trlnh c6 thti rhea d6 dti cai d~t nhung phffn m~m ling dl;lng ffiQtcach hi~u qua, va khong nhfft thie't mQi vffn d~ d~u phai duQc phan tkh dti c6 duQCnhung baa cao chi tie't, r6i sail d6 mdi chuytin sang giai do~n thie't ke' Tli nhG'ng quail ditim phan rIch, thie't ke' h~ thO'ng rhea hudng dO'i tuQngnhu da lieu tren ma phan tkh thie't ke' h~ thO'ngrhea hudng dO'ituQng da chin mu6i mQt cach tie'p c~n c6 hi~u llfc va thlfc te' Wi vi~c phat tritin phffn m~m va d~t hi~u qua "dung l~i" Tuy v~y, "slf dung l~i" v~n bi h~n che' mQt sO'nguyen nhan sail day [13]: Trang - Trang nhi~u tntong hQp, khong th€ n~lOd~c ta duQc dfty dli mQt vin d~ tu dftu Vi~c lam ban mftu lam sinh di;icta thl!c hi~n duQc, tuc la ban mftu ph\lc V\l nhu mQt bi€u di~n cha yell cftu, chung co th€ duQc ki€m chung va phan tfch them nii'a Phan tfch huang d6i tuQng co th€ dftn d~n vi~c lam ban mftu ctfc ky hi~u qua, d€ ti~n hanh dung d~n vi~c lam ban mftu, co th€ cftn Wi nhii'ng cong C\l va ky thu~t d~c bi~t MQt cach d€ lam ban mftu nhanh la l~p rap, thay vi xay dtfng, ban mftu duQc lam bAng cach dung l~i mQt t~p cac phftn phftn m~m da co san MQt phftn phftn m~m co th€ la mQt ciu truc dii' li~u (hay co sa dii' li~u) hay mQt phftn ki€n truc phftn m~m (nhu chuang trinh) hay mQt phftn thli Wc (nhu mQt mo dun) Trang m8i truong hQp, phftn phftn m~m phai duQc thi~t ke-'thea cach thuc lam cha chung co th€ duQc dung l~i ma khong cftn bi~t chi ti~t v~ cach lam vi~c bell trang Tuy nhien, vi~c lam ban mftu va dung l~i cac phftn phftn m~m chi ha~t dQng duQc'n€u h~ th6ng thu vi~n da duQc phat tri€n saa cha cac phftn thtfc t6n t~i co th€ duQc dua vaa danh m\lc va tlm ki~m l~i M~c du nguoi ta da t~a mQt sO'cong C\l d~c bi~t d€ dap ling yell cftu nay, nhung vftn nhi~u h~n ch~ cha vi~c xay dtfng thu vi~n, va stf dung l~i chi a d~ng ma ngu6n (mQt ciu truc dii' li~u hay mQt phftn ki~n truc phftn m~m, hay mQt phftn thli t\lc) Vi th~, nhi~u vi~c cftn phai lam nii'a - Vi~c dung cac lOp, lOp can va k~ thua co tftm quail tn;mg chli ch6t Trang cong ngh~ ph~n m€m hi~n d~i Tuy nhien, khong gi6ng cac khai ni~m thie't ke' khac dQc l?p vai ligon ngii' l?p trinh, vi~c cai d~t cho lOp, lOp va cac d6i tuQng thay d6i theo ligon ngii' l?p trinh duQcdung Bdi 19do nay, thao lu?n t6ng quat tru'ac day phai duQc saa d6i hoan canh ligon ngii' l?p trinh chuyen dl;lng Ch~ng h~n, Ada cai d~t d6i tuQng nhu mQt goi (package) va d~t duQc cac d6i tuQng thong qua vi~c dung cac truu tuQng va dinh ki€u dii' li~u Ngon ngii' l?p trinh Smalltalk m~t khac l~i cai d~t tung khai ni~m duQc mo tit mQt cach tnjc tie'p, lam cho chung la mQt ligon ngii' l?p trinh huang d6i tuQng dung nghla VI the', st! dung l~i d day phl;l thuQc vao ligon ngii' l?p trinh - Thu vi~n cac ph~n m€m sa dl;lng l~i da co cac ling dl;lng thuong m~i, cac h~ th6ng va cong vi~c th(ji gian tht!c, cac va'n d€ cong ngh~ va khoa hQc Tuy nhien st! dung l~i chI dung l~i d ph~n m€m t~o chung, bell c~nh d6, qua it cac ky thu?t h~ th6ng d€ b6 sung cho mQt thu vi~n, cac giao di~n chu§n cho ph~n m€m dung l~i ra't kh6 tang cuong, -va'n°d€ cha't luQng va baa tri v~n chua duQc giai quye't, va mQt di€u quail trQng, nguoi phat tri€n thuong khong bie't r~ng cac kh6i xay dt!ng ph~n m€m thich hQp th?m chi da t6n t~i! - Nguoi l?p ke"ho~ch ph~n m€m phai xem xet Wi hai "qui tdc" ph~n m€m dung l~i duQcxac dinh nhu mQttai nguyen : Ne'u ph~n m€m hi~n c6 dap ling duQc yell c~u thl chi phi d€ c6 duQCph~n m€m hi~n co g~n nhu baa gio cling it bon chi phi d€ Trang pha t tritin ph~n m6m tuong duong Nhung n€u ph~n m6m hi~n co doi hoi "siIa d6i nao do" trudc no co thti duQc tich hQp dung dan vdi h~ thO"ngthl chi phi dti siIa d6i cho ph~n m6m hi~n co doi co thti ldn hon ra't nhi6u so vdi chi phi phat tritin ph~n m6m tuong duong Tli do, cac nha khoa hQc da dua mQt cach nhln mdi theo hudng dO"i tuQng dti "st! dung l';li" d';lt hi~u qua hall, vdi chi phi d muc tha'p nha't, va cach nhln co duQc d~t ten la cach ti€p c~n to"[8] Vdi cach ti€p c~n to": - Cling ca'p cho chung ta mQt kha nang co thti lap rap va bitiu di~n cac ldp cling vdi cac qui lu~t rang buQc da duQc dinh nghia r6 rang, VI v~y, chung ta co thti dung l';li chung d muc cao hon ma ngu6n, nghIa la d ngoai ma ngu6n co cac so d6 d~c ta va cac thi€t k€ chi ti€t - Cach ti€p c~n to" v~n khong hac bo thu vi~n cac ldp ma chung dua cac ngon ngii' m~u (pattern languages) dti cQt ch~t cac ldp l';li vdi M~t khac, cach ti€p c~n to"con dua khai ni~m v6 ph';lm vi ung dlJng cua mQt h~ th6ng dti chung d';l duQc st! dung l';lid muc dQcao nha't t - Chi phi thich ung vdi cac yell c~u mdi se giam dang kti va it sai sot VIcac siIa d6i duQc t~p trung d mQt ch6 co ch€ qUail ly va d~c tinh dung l';li cua cach ti€p c~n to" Trang Nhu the', slf dung l(;litheo cach tie'p c~n to' khong don thuftn la thu vi~n cac lOp dO'ituQng ma chung baa g6m cac phftn khac bon nua va cac phftn se duQcd~ c~p chi tie't chuang cua lu~n van Lu~n van baa g6m chuang: Chlidng : Gidi thi~u v~ tinh dung l~i phan tich thie't ke' huang dO'ituQng cling vai nhung h(;lnche' "dung l'.ti" cua chung va tu tren n~n tang huang dO'ituQng, cac nha khoa hQc dff dua cach ti€p c~n to' d€ giup cho "slf dung l(;li" d(;lthi~u qua to't bon Chlidng : Khao sat cach tie'p c~n to'trong qua trlnh Kay dlfng va phat tri€n phftn m~m Qua do, chung ta tha'y duQc cach tie'p c~n huang tai mlJc lieu : "xay dlfng mQt h~ thO'ngnhanh bon, dfty du bon vai chi phi Kay dlfng va baa trl tha'p nha't" Chlidng : Trong chuang nay, lu~n van se trlnh bay ling dlJng cach ti€p c~n to' phan tich, thi€t ke' mQt h~ thO'ngthong tin va d€ minh hQa tinh kha thi cua cach ti€p c~n h~ thO'ngthong tin, h~ thO'ng qUail ly cac giao dich d~t truac se duQc chQn bai ly sail : Khi Kay dlfng ho~c phat tri€n cac h~ thO'ng thong tin, chung ta thuong g~p cac yell cftu nhu la: khach d~t phong khach s(;lntrong h~ thO'ng thong tin qUail ly kha"chS(;ln cua mQt Cong Ty"X, sinh vien dang ky muQn sach thu vi~n h~ thO'ng qUail ly thu vi~n cua mQt truong d(;li hQc Y ho~c d~t mila hang cua mQt Cong Ty Z nhfi'ng va'n d~ nam cac h~ thO'ngling dlJng khac nhung chung co cung mQt ban cha't, chinh la nhfi'ng dich VlJd~t truac va bai loan chung duQc d~t la : Kay Trang dlfng mQt h~ thO'ngthong tin qUail ly cae dich vv d~t tnfac d~ co th~ dung l~i nhi~u l1nhvlfc li'ng dvng khac Va each liSp c~n to' r§t thich h