CS3505/5020 Software Practice II
Software process overview Sequence diagrams
CS 3505 L11 - 1
CS3505/5020 Software Practice II Software process overview - - PowerPoint PPT Presentation
CS3505/5020 Software Practice II Software process overview Sequence diagrams CS 3505 L11 - 1 Software Processes What is software process? Process is the area of software engineering concerned with organizing software development
CS 3505 L11 - 1
CS 3505
CS 3505
Fundamentally, to develop software you must do what things?
Each of the software processes do these, but vary in how they
CS 3505
CS 3505
» Some claim that it is THE difference.
» See “Software Runaways” (Robert L. Glass) for some true horror stories.
CS 3505
CS 3505
– Taken directly from use case
– Anonymous instance of a class
» can also be specific instance
– Box notation – Just use the name
– Box notation – Underline name – You will see:
» Object : Class (either optional)
– Extended downward from middle of participant is lifeline
» A dashed line indicating activity of the participant
– Time flows from top to bottom
: StoreFront
Lifeline Participants TIME
CS 3505
– Line with an arrow head – Several different kinds of messages
» See table » Does Object creation and found/lost make sense? – Maybe
– Some use diagonal lines to indicate that it takes a LONG time
– But you should use them when you need to improve clarity
– Most of the message types are possible Asynchronous Method call Object Creation Return Found/Async Found/Call Lost/Async Lost/Call Self-Call
CS 3505
– But mostly they are used
– Can include arguments or types – UML 1.x allowed inclusion of a guard (in square brackets)
» Guard = Boolean statement that indicates the message will happen if the guard evaluates to true » For example: [balance <> 0] » UML 2 uses a “combined fragment” (see later)
– Helps make it clear ordering of messages
CS 3505
– That is, it is “on the stack”
– When drawing on the board I usually leave them off
– Because it is “obvious” when the return happens Activation Nesting
CS 3505
– A visual border – Is also used a lot internally to sequence diagrams
– Can use frame boundary to indicate messages to and from the internal diagram
Diagram
Foo(…)
CS 3505
– What if you wanted to have several messages that were “guarded”? – What you did in UML 1.x was duplicated the guard
– A frame with a specific name – Opt – optional (same as a guard) – Alt – alternative (if then else type of statement) – Loop – a way of indicating n occurrences
CS 3505
[balance <> 0]
[balance < 100.00] [balance >= 100.00] alt [balance < 0] loop
While loop
CS 3505
– Allows you to compose sequence diagrams – Essentially “call” a sequence diagram
CS 3505
– Either by self-destructing (lifeline termination) – Or by a message arrival into the X
CS 3505
– Similar to a break statement in a programming language – Another way to look at it is, it is an inverted OPT
CS 3505
Customer : StoreFront : WareHouse : Distributor : Shipper 2: \IsAvailable\ 3: [Inventory = 0] \Order\ 1: [1..*] \AddItemToCart\ 4: \CheckOut\ 5: \ShipTo\ 6: \ShipItem\
CS 3505
[items in cart]
CS 3505
– Communication Diagrams are still preferred by some
– Insures that the design does cover use case functionality – Doesn’t need to be perfect, but enough detail to verify that the use case can be performed as required. – We will cover use cases shortly
CS 3505
– For example, most web systems pass between multiple classes to process/render web pages
– Diagrams show how the flow of messages in structured