DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING SIXTH SEMESTER YEAR: III CS 2353 – OBJECT ORIENTED ANALYSIS AND DESIGN
TWO MARK AND SIXTEEN MARK Q & A
1
CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN
UNIT I Introduction to OOAD – Wht i! OOAD" – Wht i! U#L" Wht r$ th$ Unit$d %roc$!!&U'( %h!$! ) C!$ !tud* – th$ N$+tG$n 'OS !*!t$,- Inc$%tion )U!$ c!$ #od$.in/ ) R$.tin/ R$.tin/ U!$ c!$! – inc.ud$- $+t$nd nd /$n$r.i0tion1 UNIT II E.ortion ) Do,in #od$.! ) indin/ conc$%tu. c.!!$! nd d$!cri%tion c.!!$! – A!!ocition! – Attriut$! – Do,in ,od$. r$4in$,$nt – indin/ conc$%tu. c.!! hi$rrchi$!) A//r$/tion nd Co,%o!ition) U#L ctiit* di/r,! nd ,od$.in/ UNIT III !*!t$, !$6u$nc$ di/r,! ) R$.tion!hi% $t7$$n !$6u$nc$ di/r,! nd u!$ c!$! Lo/ic. rchit$ctur$ nd U#L %c8/$ di/r, – Lo/ic. rchit$ctur$ r$4in$,$nt ) U#L c.!! di/r,! ) U#L int$rction di/r,! UNIT I9 GRAS': D$!i/nin/ o;$ct! 7ith r$!%on!ii.iti$! – Cr$tor – In4or,tion $+%$rt – Lo7 Cou%.in/ –Contro..$r –
2
UNIT I PART A
=1 Wht i! n o;$ct" An o;$ct i! co,intion o4 dt nd .o/ic> th$ r$%r$!$nttion o4 !o,$ r$.)7or.d $ntit*1 21 Wht i! th$ ,in dnt/$ o4 o;$ct)ori$nt$d d$$.o%,$nt" ?
Durin/ o;$ct)ori$nt$d n.*!i!- th$r$ i! n $,%h!i! on 4indin/ nd d$!criin/ th$ o;$ct!or conc$%t!in th$ %ro.$, do,in1 or $+,%.$- in th$ c!$ o4 th$ .irr* in4or,tion !*!t$,!o,$ o4 th$ conc$%t! inc.ud$ Boo8- Lirr*- nd 'tron1 Durin/ o;$ct)ori$nt$d d$!i/n- th$r$ i! n $,%h!i! on d$4inin/ !o4t7r$ o;$ct! nd ho7 th$* co..ort$ to 4u.4i.. th$ r$6uir$,$nt!1 or $+,%.$- in th$ .irr* !*!t$,- Boo 8 !o4t7r$ o;$ct ,* h$ tit.$ ttriut$ nd /$t Ch%)t$r ,$thod 1 Wht i! U#L" Uni4i$d ,od$.in/ .n/u/$ i! !$t o4 nottion! nd con$ntion! nd di/r,! to d$!cri$ nd ,od$. n %%.iction1 1 Wht r$ th$ %ri,r* /o.! in th$ d$!i/n o4 U#L" ? 'roid$ u!$r! r$d* – to u!$ $+%r$!!i$ i!u. ,od$.in/ .n/u/$ !o th$* cn d$$.o% nd $+chn/$ ,$nin/4u. ,od$.!1 ? 'roid$ $+t$n!ii.it* nd !%$ci.i0tion ,$chni!, to $+t$nd th$ cor$ conc$%t!1 ? B$ ind$%$nd$nt o4 %rticu.r %ro/r,,in/ .n/u/$ nd d$$.o%,$nt %roc$!!1 ? 'roid$ 4or,. !i! 4or und$r!tndin/ th$ ,od$.in/ .n/u/$1 ? Encour/$ th$ /ro7th o4 th$ OO too.! ,r8$t1 ? Su%%ort hi/h$r – .$$. d$$.o%,$nt conc$%t!1 ? Int$/rt$ $!t %rctic$! nd ,$thodo.o/i$!1 1 D$4in$ C.!! Di/r,1 Th$ ,in !ttic !tructur$ n.*!i! di/r, 4or th$ !*!t$,- it r$%r$!$nt! th$ c.!! !tructur$ o4 !*!t$, inc.udin/ th$ r$.tion!hi%! $t7$$n c.!! nd th$ inh$ritnc$ !tructur$1 =F1 D$4in$ Actiit* Di/r,1 A rition or !%$ci. c!$ o4 !tt$ ,chin$ in 7hich th$ !tt$! r$ ctiiti$! r$%r$!$ntin/ th$ %$r4or,nc$ o4 o%$rtion! nd th$ trn!ition! r$ tri//$r$d * th$ co,%.$tion o4 th$ o%$rtion!1 ==1 Wht i! int$rction di/r," #$ntion th$ t*%$! o4 int$rction di/r,1 Int$rction di/r,! r$ di/r,! tht d$!cri$ ho7 /rou%! o4 o ;$ct! co..ort$ to /$t th$ ;o don$ int$rction di/r,! c%tur$ th$ $hior o4 th$ !in/.$ u!$ c!$- !ho7in/ th$ %tt$rn o4 int$rction ,on/ o;$ct!1
4
Th$r$ r$ t7o 8ind! o4 int$rction ,od$.! ? S$6u$nc$ Di/r, ? Co..ortion Di/r,1 =21 Wht i! S$6u$nc$ Di/r," S$6u$nc$ di/r, i! n $!* nd intuiti$ 7* o4 d$!criin/ th$ $hior! o4 !*!t$, * i$7in/ th$ int$rction $t7$$n th$ !*!t$, nd it! $niron,$nt1 =31 Wht i! Co..ortion Di/r," Co..ortion di/r, r$%r$!$nt! co..ortion- 7hich i! !$t o4 o;$ct! r$.t$d in %rticu.r cont$+t- nd int$rction- 7hich i! !$t o4 ,$!!/$! $+chn/$d ,on/ th$ o;$ct! 7ith in co..ortion to chi$$ d$!ir$d outco,$1 =@1 D$4in$ Strt chrt Di/r,1 Strt chrt di/r, !ho7! !$6u$nc$ o4 !tt$! tht n o;$ct /o$! throu/h durin/ it! .i4$ in r$!%on!$ to $$nt!1 A !tt$ i! r$%r$!$nt$d ! round o+- 7hich ,* contin on$ or ,or$ co,%rt,$nt!1 Th$ co,%rt,$nt! r$ .. o%tion.1 =51 Wht i! ,$nt * i,%.$,$nttion di/r," I,%.$,$nttion Di/r,! !ho7 th$ i,%.$,$nttion %h!$ o4 !*!t$,! d$$.o%,$nt !uch ! th$ !ourc$ cod$ !tructur$ nd th$ run) ti,$ i,%.$,$nttion !tructur$1 Th$r$ r$ t7o t*%$! o4 i,%.$,$nttion di/r,!: =1 Co,%on$nt Di/r,! 21 D$$.o%,$nt Di/r,!1 =1 D$4in$ Co,%on$nt Di/r," A Co,%on$nt di/r,! !ho7! th$ or/ni0tion nd d$%$nd$nci$! ,on/ !$t o4 co,%on$nt!1 A co,%on$nt di/r,! r$ u!$d to ,od$. th$ !ttic i,%.$,$nttion i$7 o4 !*!t$,1 Thi! ino.$! ,od$.in/ th$ %h*!ic. thin/! tht r$!id$ on ,od$- !uch ! $+$cut.$- .irri$!- t.$!- 4i.$! nd docu,$nt!1 =1 D$4in$ D$%.o*,$nt Di/r,1 D$%.o*,$nt Di/r, !ho7! th$ con4i/urtion o4 run)ti,$ %roc$!!in/ $.$,$nt! nd th$ !o4t7r$ co,%on$nt!- %roc$!!$!- nd o;$ct! tht .i$ in th$ ,1
5
D$%.o*,$nt di/r,! r$ u!$d to ,od$. th$ !ttic d$%.o*,$nt i$7 o4 !*!t$,1 A d$%.o*,$nt di/r, i! /r%h o4 ,od$! conn$ct$d * co,,uniction !!ocition1 =1 Wht i! th$ U'" A !o4t7r$ d$$.o%,$nt %roc$!! d$!cri$! n %%roch to ui.din/- d$%.o*in/- nd %o!!i.* ,intinin/ !o4t7r$1 Th$ Uni4i$d 'roc$!! h! $,$r/$d ! %o%u.r it$rti$ !o4t7r$ d$$.o%,$nt %roc$!! 4or ui.din/ o;$ct)ori$nt$d !*!t$,!1 =1 Wht i! It$rtion!" A 8$* %rctic$ in oth th$ U' nd ,o!t oth$r ,od$rn ,$thod! i! it$rti$ d$$.o%,$nt1 In thi! .i4$c*c.$ %%roch- d$$.o%,$nt i! or/ni0$d into !$ri$! o4 !hort- 4i+$d).$n/th &4or $+,%.$thr$$)7$$8( ,ini)%ro;$ct! c..$d it$rtion! 2F1 Wht i! It$rti$ nd Eo.utionr* D$$.o%,$nt" Th$ it$rti$ .i4$c*c.$ i! !$d on th$ !ucc$!!i$ $n.r/$,$nt nd r$4in$,$nt o4 !*!t$, throu/h ,u.ti%.$ it$rtion!- 7ith c*c.ic 4$$dc8 nd d%ttion ! cor$ dri$r! to con$r/$ u%on !uit.$ !*!t$,1 Th$ !*!t$, /ro7! incr$,$nt..* o$r ti,$- it$rtion * it$rtion- nd thu! thi! %%roch i! .!o 8no7n ! it$rti$ nd incr$,$nt. d$$.o%,$nt1 B$cu!$ 4$$dc8 nd d%ttion $o.$ th$ !%$ci4iction! nd d$!i/n- it i! .!o 8no7n ! it$rti$ nd $o.utionr* d$$.o%,$nt 2=1 Wht r$ th$ 'h!$! o4 Uni4i$d 'roc$!!" Th$ Uni4i$d 'roc$!! h! @ %h!$!: – Inc$%tion: R$6uir$,$nt! c%tur$ nd n.*!i! – E.ortion: S*!t$, nd c.!!).$$. d$!i/n – Con!truction: I,%.$,$nttion nd t$!tin/ – Trn!ition: D$%.o*,$nt 221 Wht i! Inc$%tion" Inc$%tion i! th$ initi. !hort !t$% to $!t.i!h co,,on i!ion nd !ic !co%$ 4or th$ %ro;$ct1 It 7i.. inc.ud$ n.*!i! o4 %$rh%! =F o4 th$ u!$ c!$!- n.*!i! o4 th$ critic. non)4unction. r$6uir$,$nt- cr$tion o4 u!in$!! c!$- nd %r$%rtion o4 th$ d$$.o%,$nt $niron,$nt1 231 D$4in$ U!$ c!$ ,od$.in/"
6
U!$ c!$ ,od$.in/ i! 4or, o4 r$6uir$,$nt! $n/in$$rin/1
R$4$r Craig Larman,"Applying UML and Patterns: An Introd!tion to o#e!t$oriented Analysis and %esign and iterati&e de&elopment', ()ird *dition,+
=1 E+%.in T*%$! o4 U#L Di/r,! 7ith $+,%.$"'/$:== 21 E+%.in Uni4i$d 'h!$ nd th$ir t*%$! 7ith n $+,%.$"'/$:33 31 E+%.in CASE STUDY: T
UNIT$II PART A
=1 Wht i! n E.ortion" It Bui.d th$ cor$ rchit$ctur$- r$!o.$ th$ hi/h)ri!8 $.$,$nt!- d$4in$ ,o!t r$6uir$,$nt!- nd $!ti,t$ th$ o$r.. !ch$du.$ nd r$!ourc$! 21 Wht i! do,in ,od$." A do,in ,od$. i! i!u. r$%r$!$nttion o4 co nc$%tu. c.!!$! or r$.)7or.d o;$ct! in do,in o4 int$r$!t1 Th$* h$ .!o $$n c..$d conc$%tu. ,od$.!- do,in o;$ct ,od$.!- nd n.*!i! o;$ct ,od$.! 31 D$4in$ Conc$%tu. C.!!$!" Th$ do,in ,od$. i..u!trt$! conc$%tu. c.!!$! or ocu.r* in th$ do,in1 In4or,..*- conc$%tu. c.!! i! n id$- thin/- or o;$ct1 #or$ 4or,..*- conc$%tu. c.!! ,* $ con!id$r$d in t$r,! o4 it! !*,o.- int$n!ion- nd $+t$n!ion1
@1 D$4in$ D$!cri%tion C.!!" A d$!cri%tion c.!! contin! in4or,tion tht d$!cri$! !o,$thin/ $.!$1 or $+,%.$- 'roductD$!cri%tion tht r$cord! th$ %ric$- %ictur$- nd t$+t d$ !cri%tion o4 n It$,1 51 Wht r$ Thr$$ Strt$/i$! to ind Conc$%tu. C.!!$!" =1 R$u!$ or ,odi4* $+i!tin/ ,od$.!1 21 U!$ ct$/or* .i!t1 31 Id$nti4* noun %hr!$! 1 Wht i! n !!ocition" An !!ocition i! r$.tion!hi% $t7$$n c.!!$! &,or$ %r$ci!$.*- in!tnc$! o4 tho!$ c.!!$!( tht indict$! !o,$ ,$nin/4u. nd int$r$!tin/ conn$ction1 1 Wht i! n Attriut$!" An ttriut$ i! .o/ic. dt .u$ o4 n o;$ct1 It i! u!$4u. to id$nti4* tho!$ ttriut$! o4 conc$%tu. c.!!$! tht r$ n$$d$d to !ti!4* th$ in4or,tion r$6uir$,$nt! o4 th$ curr$nt !c$nrio! und$r d$$.o%,$nt1 1 Wht Aout Attriut$! in Cod$" Th$ r$co,,$ndtion tht ttriut$! in th$ do,in ,od$. $ ,in.* dt t*%$! do$! not i,%.* tht C or J ttriut$! ,u!t on.* $ o4 !i,%.$- %ri,iti$ dt t*%$!1 Th$ do,in ,od$. i! conc$%tu. %$r!%$cti$- not !o4t7r$ on$1 In th$ D$!i/n #od$.- ttriut$! ,* $ o4 n* t*%$1 1 Wht i! D$ri$d Attriut$!" Th$ tot. ttriut$ in th$ S.$ cn $ c.cu.t$d or d$ri$d 4ro, th$ in4or,tion in th$ S.$!Lin$It$,!1 Wh$n 7$ 7nt to co,,unict$ tht =( thi! i! not$7orth* ttriut$- ut 2( it i! d$ri.$- 7$ u!$ th$ U#L con$ntion: M !*,o. $4or$ th$ ttriut$ n,$1 =F1 Wh$n to D$4in$ N$7 Dt T*%$ C.!!$!" In th$ N$+tG$n 'OS !*!t$, n it$,ID ttriut$ i! n$$d$d> it i! %ro.* n ttriut$ o4 n It$, or 'roductD$!cri%tion1 C!u..*- it !$$,! .i8$ ;u!t nu,$r or %$rh%! !trin/1 or $+,%.$it$,ID : Int$/$r or it$,ID : Strin/1 ==1 D$4inin/ Conc$%tu. Su%$r c.!!$! nd Suc.!!$!"
-
It i! .u.$ to id$nti4* conc$%tu. !u%$r) nd !uc.!!$!- it i! u!$4u. to c.$r.* nd %r$ci!$.* und$r!tnd /$n$r.i0tion- !u%$r c.!!$!- nd !uc.!!$! in t$r,! o4 c.!! d$4inition nd c.!! !$t!1 =21 Wht i! G$n$r.i0tion" G$n$r.i0tion i! th$ ctiit* o4 id$nti4*in/ co,,on.it* ,on/ conc$%t! nd d$4inin/ !u%$rc.!! &/$n$r. conc$%t( nd !uc.!! &!%$ci.i0$d conc$%t( r$.tion!hi%!1 =31 Wht i! A//r$/tion" A//r$/tion i! /u$ 8ind o4 !!ocition in th$ U#L tht .oo!$.* !u//$!t! 7ho.$)%rt r$.tion!hi%! &! do ,n* ordinr* !!ocition!(1 It h! no ,$nin/4u. di!tinct !$,ntic! in th$ U#L $r!u! %.in !!ocition- ut th$ t$r, i! d$4in$d in th$ U#L1 =@1 Wht i! Co,%o!ition" Co,%o!ition- .!o 8no7n ! co,%o!it$ //r$/tion- i! !tron/ 8ind o4 7ho.$)%rt //r$/tion nd i! u!$4u. to !ho7 in !o,$ ,od$.!1 A co,%o!ition r$.tion!hi% i,%.i$! tht =( n in!tnc$ o4 th$ %rt $.on/! to on.* on$ co,%o!it$ in!tnc$ t ti,$- 2( th$ %rt ,u!t .7*! $.on/ to co,%o!it$ nd 3( th$ co,%o!it$ i! r$!%on!i.$ 4or th$ cr$tion nd d$.$tion o4 it! %rt! $ith$r * it!$.4 cr$tin/Md$.$tin/ th$ %rt!- or * co..ortin/ 7ith oth$r o;$ct!1 =51 Wht i! U#L Actiit* Di/r,!" A U#L ctiit* di/r, !ho7! !$6u$nti. nd %r..$. ctiiti$! in %roc$!!1 Th$* r$ u!$4u. 4or ,od$.in/ u!in$!! %roc$!!$!- 7or84.o7!- dt 4.o7!- nd co,%.$+ ./orith,!1 =1
=1 E+%.in Do,in #od$.! 7ith n $+,%.$"'/$:=3= 21 E+%.in Conc$%tu. C.!!$! 7ith n $+,%.$ nd 7ht r$ Thr$$ Strt$/i$! to ind Conc$%tu. C.!!$!"'/$:=3 31 E+%.in D$!cri%tion! 7ith th$ Air.in$ Do,in $+,%.$"'/$:=@ @1 E+%.in A!!ocition! 7ith A%%.*in/ U#L"'/$:=@ 51 E+%.in Attriut$ 7ith A%%.*in/ U#L"'/$:= .
1 Wht r$ Suit.$ Attriut$ T*%$!" E+%.in ocu! on Dt T*%$ Attriut$! in th$ Do,in #od$.1 1 E+%.in Conc$%tu. Su%$rc.!!$! nd Suc.!!$! 7ith n $+,%.$"'/$:5F5 1 E+%.in A//r$/tion nd Co,%o!ition" '/$:5= 1 E+%.in U#L Actiit* Di/r,! nd #od$.in/" ' /$:@
UNIT III PART A
=1 Wht i! !*!t$, !$6u$nc$ di/r," A !*!t$, !$6u$nc$ di/r, &SSD( i! 4!t nd $!i.* cr$t$d rti4ct tht i..u!trt$! in%ut nd out%ut $$nt! r$.t$d to th$ !*!t$,! und$r di!cu!!ion1 Th$* r$ in%ut to o%$rtion contrct! nd ,o!t i,%ortnt.* o;$ct d$!i/n1 21 Wht r$ S*!t$, S$6u$nc$ Di/r,!" A !*!t$, !$6u$nc$ di/r, i! %ictur$ tht !ho7!- 4or on$ %rticu.r !c$nrio o4 u!$ c!$- th$ $$nt! tht $+t$rn. ctor! /$n$rt$ th$ir ord$r- nd int$r)!*!t$, $$nt!1 A.. !*!t$,! r$ tr$t$d ! .c8 o+> th$ $,%h!i! o4 th$ di/r, i! $$nt! tht cro!! th$ !*!t$, oundr* 4ro, ctor! to !*!t$,!1 31 Wht i! th$ Lo/ic. Archit$ctur$" Th$ .o/ic. rchit$ctur$ i! th$ .r/$)!c.$ or/ni0tion o4 th$ !o4t7r$ c.!!$! into %c8/$! &or n,$!%c$!(- !u!*!t$,!- nd .*$r!1 It! c..$d th$ .o/ic. rchit$ctur$ $cu!$ th$r$! no d$ci!ion out ho7 th$!$ $.$,$nt! r$ d$%.o*$d cro!! di44$r$nt o%$rtin/ !*!t$, %roc$!!$! or cro!! %h*!ic. co,%ut$r! in n$t7or81 @1 Wht i! L*$r" A .*$r i! $r* cor!$)/rin$d /rou%in/ o4 c.!!$!- %c8/$!- or !u!*!t$,! tht h! coh$!i$ r$!%on!ii.it* 4or ,;or !%$ct o4 th$ !*!t$,1 A.!o- .*$r! r$ or/ni0$d !uch tht Phi/h$rP .*$r! &!uch ! th$ UI .*$r( c.. u%on !$ric$! o4 P.o7$rP .*$r!- ut not nor,..* ic$ $r!1 51 Wht i! So4t7r$ Archit$ctur$" An rchit$ctur$ i! th$ !$t o4 !i/ni4icnt d$ci!ion! out th$ o r/ni0tion o4 !o4t7r$ !*!t$,- th$ !$.$ction o4 th$ !tructur. $.$,$nt! nd th$ir int$r4c$! * 7hich th$ !*!t$, i! co,%o!$dto/$th$r 7ith th$ir $hior ! !%$ci4i$d in th$ co..ortion! ,on/ tho!$ $.$,$nt!- th$ 1/
co,%o!ition o4 th$!$ !tructur. nd $hior. $.$,$nt! into %ro/r$!!i$.* .r/$r !u!*!t$,!nd th$ rchit$ctur. !t*.$ tht /uid$! thi! or/ni0tion th$!$ $.$,$nt! nd th$ir int$r4c$!- th$ir co..ortion!- nd th$ir co,%o!ition1 1 Wht! th$ Conn$ction B$t7$$n SSD!- S*!t$, O%$rtion!- nd L*$r!" Th$ SSD! i..u!trt$ th$!$ !*!t$, o%$rtion!- ut hid$ th$ !%$ci4ic UI o;$ct!1 N$$rth$.$!!nor,..* it 7i.. $ o;$ct! in th$ UI .*$r o4 th$ !*!t$, tht c%tur$ th$!$ !*!t$, o%$rtion r$6u$!t!- u!u..* 7ith rich c.i$nt GUI or W$ %/$1 1 Wht i! contro..$r" A contro..$r i! th$ 4ir!t o;$ct $*ond th$ UI .*$r tht i! r$!%on!i.$ 4or r$c$iin/ or hnd.in/ !*!t$, o%$rtion ,$!!/$1 1 Wht i! U#L C.!! Di/r,!" Th$ U#L inc.ud$! c.!! di/r,! to i..u!trt$ c.!!$!- int$r4c$!- nd th$ir !!ocition!1 Th$* r$ u!$d 4or !ttic o;$ct ,od$.in/1 1 D$4in$ C.!!i4i$r" A U#L c.!!i4i$r i! P ,od$. $.$,$nt tht d$!cri$! $hior. nd !tructur$ 4$tur$!P C.!!i4i$r! cn .!o $ !%$ci.i0$d1 Th$* r$ /$n$r.i0tion o4 ,n* o4 th$ $.$,$nt! o4 th$ U#L- inc.udin/ c.!!$!- int$r4c$!- u!$ c!$!- nd ctor!1 In c.!! di/r,!- th$ t7o ,o!t co,,on c.!!i4i$r! r$ r$/u.r c.!!$! nd int$r4c$!1 =F1 Wht i! U#L O%$rtion!" A U#L o%$rtion i! d$c.rtion- 7ith n,$- %r,$t$r!- r$turn t*%$- $+c$%tion! .i!t- nd %o!!i.* !$t o4 con!trint! o4 %r$)nd %o!t)condition!1 But- it i!nt n i,%.$,$nttion rth$r,$thod! r$ i,%.$,$nttion!1 ==1 Wht i! U#L #$thod" A U#L ,$thod i! th$ i,%.$,$nttion o4 n o%$rtion> i4 con!trint! r$ d$4in$d- th$ ,$thod ,u!t !ti!4* th$,1 A ,$thod ,* $ i..u!trt$d !$$r. 7*!- inc.udin/: ? in int$rction di/r,!- * th$ d$ti.! nd !$6u$nc$ o4 ,$!!/$! ? in c.!! di/r,!- 7ith U#L not$ !*,o. !t$r$ot*%$d 7ith Q,$thod =21 Wht i! U#L $*7ord" A U#L 8$*7ord i! t$+tu. dorn,$nt to ct$/ori0$ ,od$. $.$,$nt1 or $+,%.$- th$ 8$*7ord to ct$/ori0$ tht c.!!i4i$r o+ i! n int$r4c$ i! &!hoc8in/ !ur%ri!$( Qint$r4c$1 11
Wht r$ U#L 'ro%$rti$! nd 'ro%$rt* Strin/!" In th$ U#L- %ro%$rt* i! P n,$d .u$ d$notin/ chrct$ri!tic o4 n $.$,$nt1 A %ro%$rt* h! !$,ntic i,%ct1P So,$ %ro%$rti$! r$ %r$d$4in$d in th$ U#L- !uch ! i!ii.it* %ro%$rt* o4 n o%$rtion1 Oth$r! cn $ u!$r)d$4in$d1 'ro%$rti$! o4 $.$,$nt! ,* $ %r$!$nt$d in ,n* 7*!- ut t$+tu. %%roch i! to u!$ th$ U#L %ro%$rt* !trin/ n,$=V.u$=- n,$2V.u$2 4or,t- !uch ! !trct- i!ii.it*V%u.ic1 So,$ %ro%$rti$! r$ !ho7n 7ithout .u$- !uch ! !trct> thi! u!u..* i,%.i$! oo.$n %ro%$rt*- !horthnd 4or !trctVtru$1 Not$ tht !trct i! oth n $+,%.$ o4 con!trint nd %ro%$rt* !trin/1 =31 Wht i! 6u.i4i$d !!ocition" A 6u.i4i$d !!ocition h! 6u.i4i$r tht i! u!$d to !$.$ct n o;$ct &or o;$ct!( 4ro, .r/$r !$t o4 r$.t$d o;$ct!- !$d u%on th$ 6u.i4i$r 8$*1 =@1 Wht i! n !!ocition c.!!" An !!ocition c.!! ..o7! *ou tr$t n !!ocition it!$.4 ! c.!!- nd ,od$. it 7ith ttriut$!o%$rtion!- nd oth$r 4$tur$!1 or $+,%.$- i4 Co,%n* $,%.o*! ,n* '$r!on!- ,od$.$d 7ith n E,%.o*! !!ocition- *ou cn ,od$. th$ !!ocition it!$.4 ! th$ E,%.o*,$nt c.!!- 7ith ttriut$! !uch ! !trtDt$1 =51 Wht i! S$6u$nc$ di/r," S$6u$nc$ di/r,! i..u!trt$ int$rction! in 8ind o4 4$nc$ 4or,t- in 7hich $ch n$7 o;$ct i! dd$d to th$ ri/ht1 =1 Wht i! Co,,uniction di/r," Co,,uniction di/r,! i..u!trt$ o;$ct int$rction! in /r%h or n$t7or8 4or,t- in 7hich o;$ct! cn $ %.c$d n*7h$r$ on th$ di/r, P!"# –B &= #r8!(
=1 E+%.in S*!t$, !$6u$nc$ di/r,! 7ith n E+,%.$" '/$:=5 21 E+%.in .o/ic. rchit$ctur$ nd U#L %c8/$ di/r,!" '/$:2F= 31 Wht! th$ Conn$ction B$t7$$n SSD!- S*!t$, O%$rtion!- nd L*$r!" '/$:2=F @1 E+%.in Lo/ic. rchit$ctur$ r$4in$,$nt" '/$:= 51 E+%.in U#L c.!! di/r,!" '/$:2@
12
1 E+%.in Int$r)L*$r nd Int$r)'c8/$ Int$rction" '/$:= 1 E+%.in U#L Int$rction Di/r,!" '/$:22=
UNITI*
'ART ) A =1 Wht i! GRAS'" G$n$r. R$!%on!ii.it* A!!i/n,$nt So4t7r$ 'tt$rn! &or 'rinci%.$!(- r$it$d GRAS'con!i!t! o4 /uid$.in$! 4or !!i/nin/ r$!%on!ii.it* to c.!!$! nd o;$ct! in o;$ct)ori$nt$d d$!i/n1 21 Wht i! R$!%on!ii.it*)Dri$n D$!i/n" A %o%u.r 7* o4 thin8in/ out th$ d$!i/n o4 !o4t7r$ o;$ct! nd .!o .r/$r !c.$ Co ,%on$nt! 3 r$ in t$r,! o4 r$!%on!ii.iti$!- ro.$!- nd co..ortion!1 Thi! i! %rt o4 .r/$r %%roch c..$d r$!%on!ii.it*)dri$n d$!i/n or RDD1 31 Wht i! R$!%on!ii.iti$!" Th$ U#L d$4in$! r$!%on!ii.it* ! H contrct or o.i/tion o4 c.!!i4i$r1 R$!%on!ii.iti$! r$ r$.t$d to th$ o.i/tion! or $hior o4 n o;$ct in t$r,! o4 it! ro.$1 @1 Wht r$ th$ t7o r$!%on!ii.iti$!" Th$ r$!%on!ii.iti$! r$ o4 th$ 4o..o7in/ t7o t*%$!: doin/ nd 8no7in/1 Doin/ r$!%on!ii.iti$! o4 n o;$ct inc.ud$: ? doin/ !o,$thin/ it!$.4- !uch ! cr$tin/ n o;$ct or doin/ c.cu.tion ? inititin/ ction in oth$r o;$ct! ? contro..in/ nd coordintin/ ctiiti$! in oth$r o;$ct! no7in/ r$!%on!ii.iti$! o4 n o;$ct inc.ud$: ? 8no7in/ out %rit$ $nc%!u.t$d dt ? 8no7in/ out r$.t$d o;$ct! ? 8no7in/ out thin/! it cn d$ri$ or c.cu.t$
13
51 D$4in$ 'tt$rn" A %tt$rn i! n,$d %ro.$,M!o.ution %ir tht cn $ %%.i$d in n$7 cont$+t- 7ith dic$ on ho7 to %%.* it in no$. !itution! nd di!cu!!ion o4 it! trd$)o44! 1 Wht r$ th$ GRAS' %tt$rn!" Th$* d$!cri$ 4und,$nt. %rinci%.$! o4 o;$ct d$!i/n nd r$!%on!ii.it* !!i/n,$nt1 $+%r$!!$d ! %tt$rn!1 1 ? .o7 i,%ct in c.!! o4 chn/$! in oth$r c.!!$!> ? hi/h r$u!$ %ot$nti.>
14
==1 D$4in$ ? ,8$ cod$ tht u!$! th$ .irr* ,or$ r$d.$- 4or th$ !,$ r$!on> ? r$duc$ d$%$nd$nci$! o4 out!id$ cod$ on th$ inn$r 7or8in/! o4 .irr*- !inc$ ,o!t cod$ u!$! th$ 4cd$- thu! ..o7in/ ,or$ 4.$+ii.it* in d$$.o%in/ th$ !*!t$,> ? Wr% %oor.*)d$!i/n$d co..$ction o4 A'I! 7ith !in/.$ 7$..)d$!i/n$d A'I &! %$r t!8 n$$d!(1 =1 Wht i! O!$r$r %tt$rn" 15
Th$ o!$r$r %tt$rn & !u!$t o4 th$ %u.i!hM!u!cri$ %tt$rn( i! !o4t7r$ d$!i/n %tt$rn in 7hich n o;$ct- c..$d th$ !u;$ct- ,intin! .i!t o4 it! d$%$nd$nt!- c..$d o!$r$r!- nd noti4i$! th$, uto,tic..* o4 n* !tt$ chn/$!- u!u..* * c..in/ on$ o4 th$ir ,$thod!1 It i! ,in.* u!$d to i,%.$,$nt di!triut$d $$nt hnd.in/ !*!t$,!1 P!"# –B &= #r8!(
=1 E+%.in GRAS': D$!i/nin/ o;$ct! 7ith r$!%on!ii.iti$!" '/$:2= 21 E+%.in Go DESIGN 'ATTERNS" '/$:@35 31 E+%.in Cr$tor nd In4or,tion E+%$rt 7ith n E+,%.$" '/$:2=-2@ @1 E+%.in Lo7 Cou%.in/ nd Contro..$r 7ith n E+,%.$" '/$:2-3F2 51 E+%.in d%t$r nd !in/.$ton 7ith n $+,%.$" '/$:@3-@@2 1 E+%.in 4ctor* nd o!$r$r %tt$rn!1 '/$:@@F-@3 UNIT *
'ART ) A =1 Wht i! U#L Stt$ ,chin$ Di/r," A U#L !tt$ ,chin$ di/r,- i..u!trt$! th$ int$r$!tin/ $$nt! nd !tt$! o4 n o;$ct- nd th$ $hior o4 n o;$ct in r$ction to n $$nt1 21 D$4inition!: E$nt! 7ith $+,%.$" An $$nt i! !i/ni4icnt or not$7orth* occurr$nc$1 or $+,%.$: ? A t$.$%hon$ r$c$i$r i! t8$n o44 th$ hoo81 31 D$4inition!: Stt$! 7ith n $+,%.$" A !tt$ i! th$ condition o4 n o;$ct t ,o,$nt in ti,$ th$ ti,$ $t7$$n $$nt!1 or $+,%.$: ? A t$.$%hon$ i! in th$ !tt$ o4 $in/ Pid.$P 4t$r th$ r$c$i$r i! %.c$d on th$ hoo8 nd unti. it i! t8$n o44 th$ hoo81 @1 D$4inition!: Stt$! 7ith n $+,%.$" A trn!ition i! r$.tion!hi% $t7$$n t7o !tt$! tht indict$! tht 7h$n n $$nt occur!- th$ o;$ct ,o$! 4ro, th$ %rior !tt$ to th$ !u!$6u$nt !tt$1 or $+,%.$:
16
? Wh$n th$ $$nt Po44 hoo8P occur!- trn!ition th$ t$.$%hon$ 4ro, th$ Pid.$P to Pcti$P !tt$1 51 Wht i! Stt$)Ind$%$nd$nt nd Stt$)D$%$nd$nt O;$ct!" I4 n o;$ct .7*! r$!%ond! th$ !,$ 7* to n $$nt- th$n it i! con!id$r$d !tt$)ind$%$nd$nt &or ,od$.$!!( 7ith r$!%$ct to tht $$nt1 I4 4or .. $$nt! o4 int$r$!t- n o;$ct .7*! r$ct! th$ !,$ 7*- it i! !tt$)ind$%$nd$nt o;$ct1 B* contr!t- !tt$)d$%$nd$nt o;$ct! r$ct di44$r$nt.* to $$nt! d$%$ndin/ on th$ir !tt$ or ,od$1 1 Wht i! D$%.o*,$nt di/r," A d$%.o*,$nt di/r, !ho7! th$ !!i/n,$nt o4 concr$t$ !o4t7r$ rti4ct! &!uch ! $+$cut.$ 4i.$!( to co,%uttion. nod$! &!o,$thin/ 7ith %roc$!!in/ !$ric$!(1 It !ho7! th$ d$%.o*,$nt o4 !o4t7r$ $.$,$nt! to th$ %h*!ic. rchit$ctur$ nd th$ c o,,uniction &u!u..* on n$t7or8( $t7$$n %h*!ic. $.$,$nt!1 1 Wht i! Co,%on$nt Di/r,!" Th$ Co,%on$nt Di/r, h$.%! to ,od$. th$ %h*!ic. !%$ct o4 n O;$ct)Ori$nt$d !o4t7r$ !*!t$,1 It i..u!trt$! th$ rchit$ctur$! o4 th$ !o4t7r$ co,%on$nt! nd th$ d$%$nd$nci$! $t7$$n th$,1 Tho!$ !o4t7r$ co,%on$nt! inc.udin/ run)ti,$ co,%on$nt!- $+$cut.$ co,%on$nt! .!o th$ !ourc$ cod$ co,%on$nt!1 1 Wht i! O%$rtion Contrct" An o%$rtion Contrct d$!cri$! th$ chn/$ in th$ !tt$ o4 th$ !*!t$, 7h$n !*!t$, o%$rtion i! ino8$d1 1 Wht i! ,$nt * n +io," Li!t th$ t7o d$!i/n +io,! o4 o;$ct ori$nt$d d$!i/n1 An +io, i! 4und,$nt. truth tht .7*! i! o!$r$d to $ .id nd 4or 7hich th$r$ i! no count$r $+,%.$ or $+c$%tion1 T7o d$!i/n +io,!: A+io, =: Th$ ind$%$nd$nc$ +io, A+io, 2: Th$ in4or,tion +io,1 =F1 Writ$ th$ ttriut$ %r$!$nttion !u//$!t$d * U#L" OCL cn $ u!$d durin/ th$ d$!i/n %h!$ to d$4in$ th$ c.!! ttriut$! 1Th$ 4o..o7in/ i! th$ ttriut$ %r$!$nttion !u//$!t$d * U#L1
1
9i!ii.it* n,$: t*%$ –$+%r$!!ion)initi.).u$ 7h$r$ i!ii.it* i! X %u.ic i!ii.it* %rot$ct$d i!ii.it* ) %rit$ i!ii.it* T*%$ – $+%r$!!ion i! .n/u/$ d$%$nd$nt !%$ci4iction 1Initi. – .u$ i! .n/u/$ d$%$nd$nt $+%r$!!ion 4or th$ initi. .u$ o4 n$7.* c r$t$d o;$ct1 ==1 Wht r$ th$ 3 r$.tion!hi%! tht cn $ !ho7n in U#L di/r," D$4in$ th$,1 =1 A!!ocition ho7 r$ o;$ct! !!ocit$d" Thi! in4or,tion 7i.. /uid$ u! in d$!i/nin/ c.!!$!1 21 Su%$r)Su Structur$
=1 E+%.in U#L !tt$ di/r,! 7ith n $+,%.$" '/$:@5 21 E+%.in O%$rtion contrct! 7ith n $+,%.$" '/$:== 1-
31 E+%.in #%%in/ d$!i/n to cod$ 7ith n E+,%.$" '/$:3 @1 E+%.in U#L d$%.o*,$nt di/r,! 7ith n $+,%.$" '/$:5= 51 E+%.in U#L co,%on$nt di/r,! 7ith n $+,%.$" '/$:53
U+,-."),#/ Q0.)#,1+ P!." 0*0(*C %*** *AMI7A(I87 , APILMA9 2/11 sit) semester Compter ;!ien!e and *ngineering C; 2353 $80<*C( 8I*7(*% A7AL9;I; A7% %*;I7 =!ommon to in>ormation te!)nology? =reglation 2//-? time: t)ree )ors
maimm: 1// mar@s
Anser ALL Bestion PA( A=1/2D2/ mar@s 1 )at is o#e!t oriented analysis and designE
Durin/ o;$ct)ori$nt$d n.*!i!- th$r$ i! n $,%h!i! on 4indin/ nd d$!criin/ th$ o;$ct!or conc$%t!in th$ %ro.$, do,in1 or $+,%.$- in th$ c!$ o4 th$ .irr* in4or,tion !*!t$,- !o,$ o4 th$ conc$%t! inc.ud$ Boo8- Lirr*- nd 'tron1 Durin/ o;$ct)ori$nt$d d$!i/n- th$r$ i! n $,%h!i! on d$4inin/ !o4t7r$ o;$ct! nd ho7 th$* co..ort$ to 4u.4i.. th$ r$6uir$,$nt!1 or $+,%.$- in th$ .irr* !*!t$,- Boo8 !o4t7r$ o;$ct ,* h$ tit.$ ttriut$ nd /$t Ch%)t$r ,$thod 2 de>ine in!eption step
Inc$%tion i! th$ initi. !hort !t$% to $!t.i!h co,,on i!ion nd !ic !co%$ 4or th$ %ro;$ct1 It 7i.. inc.ud$ n.*!i! o4 %$rh%! =F o4 th$ u!$ c!$!- n.*!i! o4 th$ critic. 1.
non)4unction. r$6uir$,$nt- cr$tion o4 u!in$!! c!$- nd %r$%rtion o4 th$ d$$.o%,$nt $niron,$nt1 3 )at is domain modelE
A do,in ,od$. i! i!u. r$%r$!$nttion o4 conc$%tu. c.!!$! or r$.)7or.d o;$ct! in do,in o4 int$r$!t1 Th$* h$ .!o $$n c..$d conc$%tu. ,od$.!- do,in o;$ct ,od$.!nd n.*!i! o;$ct ,od$.! 4 de>ine aggregation and !omposition
A//r$/tion i! /u$ 8ind o4 !!ocition in th$ U#L tht .oo!$.* !u//$!t! 7ho.$)%rt r$.tion!hi%! &! do ,n* ordinr* !!ocition!(1 It h! no ,$nin/4u. di!tinct !$,ntic! in th$ U#L $r!u! %.in !!ocition- ut th$ t$r, i! d$4in$d in th$ U#L1 Co,%o!ition- .!o 8no7n ! co,%o!it$ //r$/tion- i! !tron/ 8ind o4 7ho.$)%rt //r$/tion nd i! u!$4u. to !ho7 in !o,$ ,od$.!1 A co,%o!ition r$.tion!hi% i,%.i$! tht =( n in!tnc$ o4 th$ %rt $.on/! to on.* on$ co,%o!it$ in!tnc$ t ti,$- 2( th$ %rt ,u!t .7*! $.on/ to co,%o!it$ nd 3( th$ co,%o!it$ i! r$!%on!i.$ 4or th$ cr$tion nd d$.$tion o4 it! %rt! $ith$r * it!$.4 cr$tin/Md$.$tin/ th$ %rt!- or * co..ortin/ 7ith oth$r o;$ct!1 5 )at is t)e se o> system seBen!e diagramE
A !*!t$, !$6u$nc$ di/r, i! %ictur$ tht !ho7!- 4or on$ %rticu.r !c$nrio o4 u!$ c!$- th$ $$nt! tht $+t$rn. ctor! /$n$rt$ th$ir ord$r- nd int$r)!*!t$, $$nt!1 A.. !*!t$,! r$ tr$t$d ! .c8 o+> th$ $,%h!i! o4 th$ di/r, i! $$nt! tht cro!! th$ !*!t$, oundr* 4ro, ctor! to !*!t$,!1
6 list t)e relations)ips sed in !lass diagramE
Th$ ,in !ttic !tructur$ n.*!i! di/r, 4or th$ !*!t$,- it r$%r$!$nt! th$ c.!! !tructur$ o4 !*!t$, inc.udin/ th$ r$.tion!hi%! $t7$$n c.!! nd th$ inh$ritnc$ !tructur$1 E+,%.$ G$n$r.i0tion- S%$ci.i0tion
)at is se o> operation !ontra!tsE
An o%$rtion Contrct d$!cri$! th$ chn/$ in th$ !tt$ o4 th$ !*!t$, 7h$n !*!t$, o%$rtion i! ino8$d1 - de>ine !opling
2/
Lo7 Cou%.in/ i! n $.uti$ %tt$rn- 7hich dictt$! ho7 to !!i/n r$!%on!ii.iti$! to !u%%ort: ? .o7 d$%$nd$nc* $t7$$n c.!!$!> ? .o7 i,%ct in c.!! o4 chn/$! in oth$r c.!!$!> ? hi/h r$u!$ %ot$nti.>
. )at is t)e se o> operation !ontra!tsE
An o%$rtion Contrct d$!cri$! th$ chn/$ in th$ !tt$ o4 th$ !*!t$, 7h$n !*!t$, o%$rtion i! ino8$d1
1/ gi&e t)e meaning o> *&ent, ;tate, transition
An $$nt i! !i/ni4icnt or not$7orth* occurr$nc$1 or $+,%.$: ? A t$.$%hon$ r$c$i$r i! t8$n o44 th$ hoo81 A !tt$ i! th$ condition o4 n o;$ct t ,o,$nt in ti,$ th$ ti,$ $t7$$n $$nt!1 or $+,%.$: ? A t$.$%hon$ i! in th$ !tt$ o4 $in/ Pid.$P 4t$r th$ r$c$i$r i! %.c$d on th$ hoo8 nd unti. it i! t8$n o44 th$ hoo81 PA( 0$=516D-/ mar@s? 11 =a? rie>ly eplain t)e di>>erent p)ases o> ni>ied pro!essE '/$:= 8 =? eplain it) an eample, )o se !ase modeling is sed to des!rie >n!tional reBirements Identi>y t)e a!tors, s!enario and se !ases >or t)e eample '/$:3 12=a? des!rie t)e strategies sed to identi>y !on!eptal !lasses %es!rie t)e steps to !reate a domain model sed >or representing !on!eptal !lasses '/$:=3= 8 =? eplain aot a!ti&ity diagram it) an eample '/$:@ 13 =a? illstrate it) an eample, t)e relations)ip eteen seBen!e diagram and se !ases
'/$:= 8 =? eplain it) an eample intera!tion diagram '/$:=3 21
14 =a? eplain aot A;P patterns '/$:2= 8 =? rite s)ort notes on adapter singleton, >a!tory and oser&er patterns '/$:@35 15 =a? eplain aot implementation model=mapping design to !ode? '/$:36. 8 =? %is!ss aot UML deployment and !omponent diagrams %ra t)e diagram >or a an@ing appli!ation '/$:5=
22