CSSE374 Elaboration UML Interaction - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

CSSE374 Elaboration UML Interaction

Description:

As designers an discussion of the req your customer team did ... 50 years ago, Sviatoslav Richter decides what. Chopin Etude to practice next. Picks Op 10, No 4. ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 22
Provided by: chen6
Category:

less

Transcript and Presenter's Notes

Title: CSSE374 Elaboration UML Interaction


1
Right what you get when you google for
class. From www.backoftheclass.net/ .
CSSE374 Elaboration UML Interaction Class
Diagrams
Steve Chenoweth Day 8, Dec 12, 2008
2
Today
  • Project a handoff
  • As designers an discussion of the req your
    customer team did
  • And, youre off and running on P2 do a domain
    model for Tues 6 AM!
  • Discussion - Continue Elaboration (Design)
  • Finish Ch 13-14 discussion from yesterday
  • start UML Interaction Diagrams Ch 15
  • Maybe get to UML Class Diagrams Ch 16

3
UML Interaction Diagrams
  • The book alternates between showing
  • UML Sequence Diagrams, and
  • UML Communication Diagrams
  • Well focus on Seq Dias.
  • Save as a HW assignment, Whats better about the
    other alternative.

Ch 15
4
Sequence Diagrams
  • Like SSDs (Ch 10), but
  • At a more detailed level and
  • Showing internal workings
  • Can lead directly to code

Step 1
public class A private B myB new
B() public void doOne() myB.doTwo()
myB.doThree() //
Step 2
Fig 15.1 Sequence diagram.
5
Seq Dia NextGen POS example
  • The message makePayment is sent to an instance of
    a Register. The sender is not identified.
  • The Register instance sends the makePayment
    message to a Sale instance.
  • The Sale instance creates an instance of a
    Payment.

Step 1
Fig 15.3 Sequence diagram.
Public class Sale Private Payment
payment Public void makePayment( Money
cashTendered ) payment new Payment(
cashTendered ) // //
Step 2
6
Seq Dia - Advice
  • Most novice modelers go for class diagrams, but
    miss doing seq dias.
  • This is important because it shows the dynamics
    of the system.

7
Seq Dia - Variations
Fig 15.5
8
Seq Dia -Singletons
  • As well see later, Singleton is an important
    software pattern.
  • Only one instance of a class is allowed.
  • Often implemented by making the class constructor
    private.
  • Can show this in diagrams

Fig 15.6
9
Synchronous Msgs
  • In UML Seq Dia,
  • Solid-headed arrow synch
  • Open-headed arrow asynch
  • Whats the difference?
  • Synch waits for a reply
  • Asynch typically starts or interacts with a
    separate thread

Fig 15.8 Two ways to show a return in
synchronous messages.
10
Asynchronous Msgs
  • Dont wait for a reply to continue execution
  • Maybe you get one (eventually), maybe you dont
  • The author here uses half arrowheads to show the
    asynch messages
  • The Connect message starts a new thread
  • The X shows destruction of an object (and thread)
  • From http//www.cs.umd.edu/mvz/cmsc435-s05/pdf/ce
    ll-phone-sequence-chart.pdf.

11
More Asynch
12
Loops like in SSDs
Fig 15.12 Example UML frame.
13
Other kinds of frames
  • See pp. 231-5.
  • Example alt

14
How about polymorphic messages?
Fig 15.21
15
UML Class Diagrams
  • Static object modeling
  • Can call these design class diagrams
  • Much more specific than domain models

Fig 16.2 UML class diagrams in two perspectives.
Ch 16
16
Fig 16.1 Common UML notation
17
Typical detail - Showing collections
Fig 16.6 Two ways to show a collection attribute
in the UML.
18
Typical detail Showing dependency
  • This is also coupling
  • Reliance on another class
  • A global variable
  • A parameter, local var or static method

Fig 16.9
public class Sale public void updatePriceFor(
ProductDescription description) money
basePrice description.getPrice() // //
19
Typical detail Showing constraints
Fig 16.14 Constraints
20
Typical detail Association class
  • Treat an association as a class!

Fig 16.16
21
How to get good at design?
  • Practice!

gt 50 years ago, Sviatoslav Richter decides
what Chopin Etude to practice next. Picks Op 10,
No 4. From http//www.youtube.com/watch?v3azkJP_v
kN8
Write a Comment
User Comments (0)
About PowerShow.com