Qhov sib txawv tseem ceeb ntawm daim duab kos duab thiab cov duab kos yog tias daim duab kos duab sawv cev rau cov chav kawm thiab lawv cov kev sib raug zoo ntawm lawv thaum daim duab kos duab sawv cev rau cov khoom thiab lawv cov kev sib raug zoo ntawm lawv nyob rau lub sijhawm tshwj xeeb.
UML sawv cev rau Kev Sib Koom Ua Qauv Qauv Lus. Nws pab ua qauv cov ntsiab lus ntawm cov khoom siv los tsim cov kev daws teeb meem software. UML daim duab qhia ntau yam zoo xws li kev nkag siab txog kev ua lag luam thiab kom tau txais kev nkag siab siab ntawm cov haujlwm ua haujlwm. Muaj ob hom qauv UML tseem ceeb. Lawv yog cov qauv tsim qauv thiab kev coj tus cwj pwm. Cov qauv qauv piav qhia txog cov yam ntxwv zoo li qub ntawm qhov system. Ntawm qhov tod tes, kev coj tus cwj pwm piav qhia txog qhov xwm txheej ntawm lub cev. Daim duab kos duab thiab cov duab kos duab yog ob qhov qauv qauv UML daim duab.
Dab tsi yog Class Diagram?
Daim duab qhia chav kawm sawv cev rau qhov pom zoo li qub ntawm lub kaw lus. Nws piav txog cov yam ntxwv thiab kev ua haujlwm ntawm cov chav kawm. Daim duab qhia hauv chav kawm yog cov qauv qauv siv dav tshaj plaws rau cov khoom siv taw qhia vim tias lawv tuaj yeem ua tau ncaj qha nrog cov lus taw qhia.
Daim duab 01: Chav Kawm Daim Duab
Saum toj no yog ib qho piv txwv yooj yim ntawm daim duab kos duab. Nws yog online ordering system. Cov neeg siv, Cov Neeg Siv Khoom, Tus Thawj Coj, Order, OrderDetails yog cov chav kawm. Txhua chav kawm muaj cov yam ntxwv thiab cov txheej txheem. Cov cwj pwm piav qhia cov khoom thaum txoj kev piav qhia tus cwj pwm lossis kev ua haujlwm.
Nyob hauv daim duab kos duab, ib daim duab plaub sawv cev rau cov chav kawm. Nws ntxiv faib ua peb ntu. Sab saum toj yog sau lub npe ntawm chav kawm. Ntu nruab nrab yog rau cov cwj pwm, thiab ntu kawg yog rau cov txheej txheem. Cov neeg siv khoom hauv chav kawm muaj cov yam ntxwv xws li lub npe, chaw nyob, email, customerId, accountBalance thiab txoj hauv kev xws li sau npe, nkag mus thiab yuav khoom.
Tus cwj pwm thiab txoj hauv kev
Tus cwj pwm thiab txoj hauv kev muaj lub cim qhia pom qhov pom. Tus – sawv cev rau tus kheej. Lwm chav kawm tsis tuaj yeem nkag mus rau cov tswv cuab ntiag tug. Lawv tsuas pom tau rau cov chav kawm tshwj xeeb ntawd xwb. Lub + sawv cev rau pej xeem thiab lwm cov chav kawm tuaj yeem nkag mus rau cov tswv cuab. Feem ntau, cov yam ntxwv ntawm chav kawm yog ntiag tug, thiab cov txheej txheem yog pej xeem. Muaj lwm qhov kev pom. Qhov no hu ua tiv thaiv, thiabcim sawv cev rau nws. Tsuas yog tib cov chav kawm thiab cov tub ntxhais kawm ntawv tuaj yeem nkag mus rau cov tswv cuab tiv thaiv.
Tus Neeg Siv yog daim ntawv dav dav ntawm Tus Thawj Coj thiab Cov Neeg Siv Khoom. Ob chav kawm no tuaj yeem muaj tus cwj pwm thiab cov txheej txheem ntawm cov neeg siv chav kawm nrog rau lawv tus kheej cov yam ntxwv thiab cov txheej txheem. Cov chav kawm siv yog cov niam txiv chav kawm thaum Cov Neeg Siv Khoom thiab Cov Thawj Coj cov chav kawm yog cov menyuam kawm ntawv. Lub tswvyim no hu ua Generalization.
Cov Neeg Siv Khoom thiab Kev Txiav Txim muaj qhov sib xyaw ua ke. Chav Order tsis tuaj yeem nyob yog tsis muaj Cov Neeg Siv Khoom. Lub Order thiab OrderDetails muaj qhov sib xyaw ua ke. Yog li, chav OrderDetails tsis tuaj yeem nyob tsis muaj Order class.
Daim duab qhia chav kawm kuj sawv cev ntau ntau. Thaum xa mus rau Cov Neeg Siv Khoom thiab Kev Sib Koom Tes, cov neeg siv khoom tuaj yeem muaj xoom lossis ntau xaj. Ntawm qhov tod tes, ib qho kev txiav txim tsuas yog rau ib tus neeg siv khoom xwb. Qhov kev txiav txim thiab OrderDetails muaj 1 txog 1 kev sib raug zoo. Kev Txiav Txim tuaj yeem muaj tsuas yog ib qho OrderDetails. Cov no yog ib co hauv paus ntawm Class Diagrams.
Object Diagram yog dab tsi?
Lwm daim duab kos duab yog daim duab kos duab. Nws zoo ib yam li daim duab kos duab, tab sis nws tsom rau cov khoom. Cov ntsiab lus tseem ceeb ntawm cov duab kos duab zoo ib yam li daim duab kos duab. Cov duab kos no pab kom nkag siab txog tus cwj pwm coj thiab lawv txoj kev sib raug zoo ntawm lub sijhawm tshwj xeeb.
Daim duab 02: Object Diagram
Tus s1, s2, thiab s3 yog cov tub ntxhais kawm cov khoom, thiab lawv tso npe rau c1 cov khoom siv. L1 lecturer object qhia cov hoob c1. Tus kws qhia yam khoom l2 qhia cov chav kawm tshwj xeeb c2. Cov tub ntxhais kawm s3 cuv npe kawm c1 nrog rau chav kawm tshwj xeeb c2. Daim duab no qhia txog tias cov khoom sib cuam tshuam li cas rau ib leeg. Zuag qhia tag nrho, ib daim duab duab sawv cev rau qhov kev pom zoo li qub ntawm lub kaw lus tab sis tshwj xeeb, nws sawv cev rau qhov kev pom zoo li qub ntawm lub sijhawm tshwj xeeb.
Dab tsi yog qhov sib txawv ntawm Chav Kawm Daim Duab thiab Object Diagram?
Daim duab qhia chav kawm yog hom kab kos duab zoo li qub uas piav qhia cov qauv ntawm cov kab ke los ntawm kev qhia cov chav kawm, lawv cov cwj pwm, txoj hauv kev thiab kev sib raug zoo ntawm cov chav kawm. Daim duab kos duab kuj yog ib hom kab kos duab zoo li qub uas qhia txog qhov ua tiav lossis ib nrab saib ntawm cov qauv ntawm cov qauv ntawm lub sijhawm tshwj xeeb.
Tsis tas li ntawd, daim duab qhia chav kawm txhais cov chav kawm thiab qhia tias lawv cuam tshuam li cas rau ib leeg. Cov duab kos qhia cov khoom thiab lawv cov kev sib raug zoo. Cov chav kawm yog cov qauv tsim thiab cov khoom yog cov piv txwv ntawm cov chav kawm. Qhov no yog qhov sib txawv tseem ceeb ntawm cov duab kos duab thiab cov duab kos duab.
Ntxiv mus, hauv daim duab kos duab, cov npe hauv chav kawm pib nrog cov ntawv loj. np., Student. Hauv daim duab kos duab, cov khoom npe yog nyob rau hauv tus lej qis, thiab nws tau hais hauv qab. e.g., s1: Student
Summary – Class Diagram vs Object Diagram
Ob chav kawm thiab cov duab kos duab sawv cev zoo li qub ntawm lub kaw lus. Qhov txawv ntawm daim duab kos duab thiab cov duab kos duab yog cov duab kos duab sawv cev rau cov chav kawm thiab lawv cov kev sib raug zoo ntawm lawv thaum cov duab kos duab sawv cev rau cov khoom thiab lawv cov kev sib raug zoo ntawm lawv ntawm ib lub sijhawm. Cov duab kos no pab kom nkag siab txog qib siab ntawm qhov system.