UML 2012-2013

  • View
    12

  • Download
    0

Embed Size (px)

Text of UML 2012-2013

  • 27/08/2012

    1

    TIN4122

    1. Gii thiu mn hc2. Cc nguyn tc M hnh ha trc quan3. Cc khi nim ca Hng i tng, lp & biu

    lp4. M hnh ha Use-Case5. Cc biu tng tc6. Cc biu UML khc

    2

    Phn 0

    3

    Ging vinNguyn Vn Trung

    Mn hcGii thiu mn hcBn trng i iu g mn hc ny?

    Trc khi n vi mn hc ny, bn m t mt h thng nh th no?

    4

    Sau khi hon tt chng trnh, bn c th: Bit c UML l g S dng UML m hnh ho mt h thng

    c t m ngunm t yu cu ngi dngm t nghip vm t kin trc h thngm t trin khai h thng

    5

    L thuyt/Thc hnh/T hc: 16/8/8 Cch tnh im

    Chuyn cn Bi tp Tiu lun Thikt thcHP

    10% 30% 60%

    6

  • 27/08/2012

    2

    Phn 1

    7

    nh ngha k thut i tng (object technology) v sc mnh ca n

    Gii thiu lch s ca k thut i tng Tho lun v cch p dng k thut i tng trong

    giai on hin nay

    8

    Mt tp cc nguyn l (tru tng ha, bao gi, a hnh) hng dn xy dng phn mm, cng vi cc NNLT, CSDL, v cc cng c h tr cc nguyn l

    (Object Technology A Managers Guide, Taylor, 1997)

    9

    OT c s dng to ra cc m hnh (model) phn nh mt lnh vc (domain) c th theo thut ng ca lnh vc

    Cc m hnh c to ra bng OT phi d to, d thay i, m rng, kim nh

    10

    Cc h thng c xy dng bng OT c th thay i linh ng, c kin trc tt, v c c hi to v thi cng/ci t di dng cc thnh phn ti s dng

    OT khng ch l l thuyt m l cng ngh c kim chng trong rt nhiu d n xy dng nhiu loi h thng khc nhau

    thc hin OT, cn mt phng php tch hp mt quy trnh pht trin v mt ngn ng m hnh ha vi cc k thut v cng c xy dng thch hp

    11

    Phn nh mt thuyt n nht (single paradigm) To iu kin ti s dng kin trc v m lnh Phn nh ng cc m hnh th gii thc Xy dng h thng n nh Xy dng h thng thch nghi vi s thay i

    12

  • 27/08/2012

    3

    Cc mc chnh

    13

    H thng Client/Server v pht trin web: K thut i tng cho php ng gi thng tin nghip v thnh cc i tng qua c th x l phn tn trn Internet hoc trn mng

    14

    H thng Thi gian thc: K thut i tng cho php xy dng cc h thng thi gian thc cht lng cao v linh hot

    15

    Thit k hng i tng (Object-Orientation, OO)Kt hp d liu v quy trnh x l d liu sm trong chu trnh pht trin

    C mc bao gi caoThc y ti s dng m lnh mc caoCho php m rng phn mm

    16

    17

    nhnghadliu&cchthcxldliutchbitnhau

    18

    nhnghadliu&cchthcxldliugnlinvinhau

    KhaibokiudliuSdngtrongthct

  • 27/08/2012

    4

    Bn hiu th no v k thut i tng, im mnh ca n, im yu ca n?

    V sao bn cn chuyn qua s dng k thut i tng?

    19

    Phn 2

    20

    Tm quan trng ca m hnh ha trc quan 4 nguyn l m hnh ha trc quan Gii thiu UML Cc kiu quy trnh lin quan vi UML

    21

    M hnh l n gin ha ci c tht

    22

    M hnh ha nhm n 4 mc ch:Gip trc quan ha h thng bn mun tm hiuCho php c t cu trc v hnh vi ca mt h thnga ra mu hng dn xy dng h thngLp ti liu v cc quyt nh a ra

    Xy dng cc m hnh ca h thng phc tp khi:khng th hiu mt cch ton din h thng ,cn hiu hn na v h thng mun xy dng

    23 24

    tquantrnghn Quantrnghn

  • 27/08/2012

    5

    Nhiu i phn mm thng xy dng ng dng theo kiu tip cn vn ging nh gp my bay giyBt u lp trnh t cc yu cu ca d n

    Tn nhiu thi gian v m lnhB qua vic xy dng kin trc

    D dn n tht bi

    M hnh ha l con ng chung nht em n thnh cng cho d n

    25

    1.M hnh bn to ra s nh hng n cch bn gii quyt vn

    2.Mi m hnh c th c din t theo nhiu mc chnh xc khc nhau

    3.M hnh tt nht l m hnh lin h vi thc t nht4.Mt m hnh l cha . i vi mt h thng

    khng n gin, tt nht l nn c tip cn qua mt s m hnh c lp nhau

    26

    M hnh bn to ra s nh hng su sc n cch gii quyt vn v nh hnh gii phpTrong phn mm, cc m hnh bn chn nh hng ln theo cch nhn ca bn

    Mi cch nhn s dn n mt loi h thng khc nhau

    27

    Mi m hnh c th c din t nhiu mc chnh xc khc nhauCc loi m hnh tt nht s cho php bn chn mc chi tit, ty thuc vo:Ai xem m hnh?V sao h li cn xem m hnh?

    V d:M hnh phc tho GUI ca h thngM hnh d liu ca h thng

    28

    Mi m hnh u n gin ha ci c thc Mt m hnh tt s lm l r nhng c trng quan

    trng, nhng sai lm tim tng trong thit k

    29

    Khng c m hnh no l y c. Vi mi h thng khng tm thng, tt nht l nn tip cn bng mt tp cc m hnh gn nh l c lp nhauTo ra cc m hnh c th c xy dng v nghin cu

    mt cch ring r, nhng chng vn s c lin quan vi nhau

    30

  • 27/08/2012

    6

    31

    UML (Unified Modelling Language) l ngn ng dng

    trc quan ha (visualizing)c t (specifying)xy dng (constructing) lp ti liu (documenting)

    cc kt qu (artifact) ca h thng cn n phn mm (software-intensive system)

    32

    Vic truyn t cc m hnh khi nim vi nhau c th gy li tr khi mi ngi u ni chung mt ngn ng

    C nhiu th trong h thng phn mm m bn khng th hiu c tr khi xy dng m hnh

    Mt m hnh tng minh s to iu kin cho vic truyn t d dng

    33 34

    35 36

  • 27/08/2012

    7

    UML xy dng cc m hnh chnh xc, r rng, v y

    37

    Cc m hnh UML c th kt ni trc tip n mt s NNLTnh x n Java, C#, C++, VB, Cc bng trong CSDL quan h hoc lu trong CSDL HT

    Cho php xy dng xui: sinh m lnh t m hnh UML sang NNLT

    Cho php xy dng ngc: cu trc li mt m hnh UML t phn m lnh ci t

    38

    UML ghi li ti liu ca kin trc h thng, yu cu, kim th, k hoch d n, v qun l phin bn pht hnh

    39 40

    41

    Chng ta cn mt quy trnh pht trin h thng

    42

  • 27/08/2012

    8

    UML c lp vi nhiu quy trnh pht trin phn mm. Mt quy trnh hon ton tn dng c u th ca UML nu:c nh hng theo Use-caseTp trung kin trc (Architecture-centric)Lp v tng dn (Iterative and incremental)

    43

    UC c nh ngha cho h thng l c s cho ton b qu trnh pht trin

    Li ch ca UC:Chnh xc, n gin, d hiu cho nhiu stakeholdersGip ng b ha ni dung ca nhiu m hnh khc nhau

    44

    Kin trc ca h thng c s dng nh l ti liu chnh hnh thnh khi nim, cu trc ha, qun l, v a ra h thng cn pht trin

    Li chKim sot d n c th qun l phc tp v bo m s ton vn h thng

    Lm nn tng hiu qu cho vic ti s dng mc caoLm c s cho vic qun l d nGip pht trin hng thnh phn (component-based

    development)

    45

    Cc ri ro chnh s c phn tch trc khi u t ln Cc bc lp u s cho php nhn phn hi sm t

    NSD Vic kim th v tch hp s c tip tc Cc mc mc tiu s c tp trung trong thi gian

    ngn Tin trnh pht trin c o bng vic nh gi cc

    phn thi cng Cc phn thi cng mt phn c th c trin khai

    46

    Cc vng lp sm nht s xc nh c cc ri ro ln nht

    Mi vng lp s a ra mt phin bn c th thc thi, mt bn b sung dn ca h thng

    Mi vng lp u c tch hp v kim th

    47

    M hnh l g? 4 nguyn l m hnh ha l g? M t tng nguyn

    l UML l g? M t cc li im ca n Nhng c tnh ca quy trnh pht trin phn mm

    thch hp nht vi UML l g? M t tng c tnh Th no l mt vng lp?

    48

  • 27/08/2012

    9

    Phn 3

    49

    M t tnh tru tng, bao gi, module ha, phn cp

    M t cu trc vt l ca mt lp M t quan h gia lp v i tngnh ngha a hnh v tng qut ha Biu lp trong UML & ng dng

    50

    Mt cch khng hnh thc, mt i tng biu din mt thc th vt l, khi nim, hoc phn mmThc th vt lThc th khi nimThc th phn mm

    51

    Mt i tng l mt thc th c ranh gii r rng v c nh danh, bao gi trng thi v hnh vi

    Trng thi c biu din bng cc thuc tnh v cc mi quan h Hnh vi c biu din bng cc thao tc, phng thc v cc

    my trng thi

    52

    Trng thi (state) l iu kin hoc hon cnh xuyn sut chu trnh sng ca i tng, nhm phc v mt s iu kin, thc hin mt s hot ng, hoc ch i mt vi s kin no

    Trng thi ca i tng thng thay i theo thi gian

    53

    Hnh vi quyt nh cch thc i tng hnh ng v phn hi cc yu cu t cc i tng khc

    Cc hnh vi c biu din bng cc thao tc m i tng c th thc hin c

    54

  • 27/08/2012

    10

    Mi i tng u c mt nh danh duy nht,ngay c khi n c cng trng thi vi i tng khc

    55

    Hng i tng

    Bao

    gi

    Tru

    tn

    g h

    a

    Phn

    cp

    Mu

    n h

    a

    56

    Cc c trng c bn ca mt thc th phn bit n vi cc loi thc th khc

    nh ngha ranh gii theo quan im ca ngi quan st

    Tru tng ha khng phi l mt bn m t y , n ch ghi ch li nhng nim c bn ca mt iu g

    57 58

    Che du ci t t clientClient ch ph thuc vo giao din

    59

    To 1 class m s nguyn t PrimeCounter Vit mt chng trnh s dng lp PrimeCounter m s nguyn t

    Ci tin PrimeCounter

    60

  • 27/08/2012

    11

    Chia nh mt ci g phc tp thnh nhiu phn nh hn, qun l c

    Gip hiu c h thng phc tp

    61

    Chia nh h thng thnh nhiu moun nh hn

    62

    HthngngkHcphn

    Hthngnphcph

    HthngqunlHcphn

    HthngqunlSinhvin

    63

    TiSn

    BtngSnChngKhonTiKhonNgnHng

    CPhiu TriKhonTiKhonTK

    Ccphntcngcptrncyphncpthnncngmctrutng

    Lp (class) l m t ca mt tp cc i tng c cng thuc tnh, thao tc, mi quan h, v ng nghai tng l mt th hin (instance) ca lp

    Mt lp l mt s tru tng ha m trong , nnhn mnh cc c tnh c lin quanb qua cc c tnh khc

    64

    ClassLpHc

    Thuc tnhTn

    Phng hcS bui hc

    S titThi im buThi im kthc

    Hnh viThm mt SVXa mt SVXem TKB

    65

    Lp c biu din trong UML bng mt hnh ch nht vi cc ngn

    66

  • 27/08/2012

    12

    Mt lp c 3 phnTn lpCu trc (cc thuc tnh - attributes)Hnh vi (cc thao tc - operations)

    67

    Lp l nh ngha tru tng ca i tngLp nh ngha cu trc v hnh vi ca mi i tng thuc v lp

    Lp ng vai tr nh l mu to ra i tng Lp khng phi l tp hp cc i tng

    68

    Thuc tnh l c tnh c tn ca lp, m t di gi tr m c tnh ca i tng c th cLp c th c 1, nhiu, hoc khng c thuc tnh no

    69 70

    Mt dch v c th c yu cu t mt i tng tc ng n hnh vi. Mt thao tc c mt k hiu gii hn cc tham s c th c

    Mt lp c th c 1, nhiu, hoc khng c thao tc no

    71

    C 4 mc:+ public: dng mi ni~ package: dng mi ni trong phm vi gi# protected: dng trong nh ngha lp & lp k tha - private: ch c dng trong