ISQS7338--DCD

18 s u p e r c la s s f o o or s u p e r c la s s f o

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: u p e r C la s s F o o { a b s tr a c t } 3 com m on c o m p a rtm e n ts 1 . c la s s ifie r n a m e 2 . a ttr ib u te s 3 . o p e r a tio n s a n in te rfa c e s h o w n w ith a k e y w o rd « in te r fa c e » R u n n a b le r u n () - c la s s O r S ta tic A ttrib u te : I n t + p u b lic A ttr ib u te : S trin g - p riv a te A ttr ib u te a s s u m e d P riv a te A ttrib u te is In itia liz e d A ttrib u te : B o o l = t r u e a C o lle c tio n : V e g g ie B u r g e r [ * ] a ttr ib u te M a y L e g a lly B e N u ll : S tr in g [ 0 .. 1 ] f in a lC o n s ta n tA ttr ib u te : I n t = 5 { r e a d O n ly } / d e r iv e d A ttr ib u te + c la s s O rS ta tic M e th o d () + p u b lic M e th o d () a s s u m e d P u b lic M e th o d ( ) - p riv a te M e th o d () # p ro te c te d M e th o d ( ) ~ p a c k a g e V is ib le M e th o d ( ) « c o n s tru c to r» S u p e r c la s s F o o ( L o n g ) m e th o d W ith P a rm s ( p a r m 1 : S trin g , p a rm 2 : F lo a t ) m e th o d R e tu rn s S o m e th in g ( ) : V e g g ie B u r g e r m e th o d T h r o w s E x c e p tio n ( ) { e x c e p tio n IO E x c e p tio n } a b s tra c tM e th o d ( ) a b s tra c tM e th o d 2 () { a b s tra c t } / / a lte r n a te fin a lM e th o d () { l e a f } / / n o o v e r rid e in s u b c la s s s y n c h ro n iz e d M e th o d ( ) { g u a rd e d } o ffic ia lly in U M L , t h e to p fo rm a t is u s e d to d is tin g u is h th e p a c k a g e n a m e fro m th e c la s s n a m e u n o ffic ia lly , t h e s e c o n d a lte r n a tiv e is c o m m o n ja v a . a w t :: F o n t or ja v a . a w t . F o n t p la in : I n t = 0 { r e a d O n ly } b o ld : I n t = 1 { r e a d O n ly } n a m e : S trin g s ty le : I n t = 0 ... g e tF o n t ( n a m e : S tr in g ) : F o n t g e tN a m e ( ) : S trin g ... F ru it dependency ... Questions? ... in te rfa c e i m p le m e n ta tio n and s u b c la s s in g S u b c la s s F o o P u r c h a s e O rd e r 1 ... ... o rd e r ru n ( ) ... - e llip s is “ … ” m e a n s th e re m a y b e e le m e n ts , b u t n o t s h o w n - a b la n k c o m p a r tm e n t o ffic ia lly m e a n s “u n k n o w n ” b u t a s a c o n v e n tio n w ill b e u s e d to m e a n “ n o m e m b e rs ” DCD summary ... a s s o c ia tio n w ith m u ltip lic itie s Figure 16.1 Designing with interaction and class diagrams l Beginners often emphasize Class diagrams l Interaction diagrams deserve more attention l Some tools can help: – – Convert between sequence and communication diagrams automatically Reflect changes in class and interaction diagrams in parallel...
View Full Document

This test prep was uploaded on 03/27/2014 for the course BUS 3373 taught by Professor Noyce during the Spring '12 term at Texas Tech.

Ask a homework question - tutors are online