software systems design – 4 class diagrams (dynamic) klaas sikkel software systemsdesign - 41

Post on 13-Dec-2015

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Design - 4 1

Software Systems

Design – 4Class Diagrams (dynamic)

Klaas Sikkel

Software Systems

Design - 4 2

Today’s topic

Software Systems

Class Diagram(static)

State MachineDiagram

datafunctionalitybehaviour

ActivityDiagram

interaction

RequirementsList

Use Case Diagram

SequenceDiagramClass Diagram

(dynamic)

System boundary

CommunicationDiagram

Design - 4 3

Contents

• From use cases to class diagrams– Collaborations– Communication diagram– Use case class diagram

• “Analysis class diagram”– Integration of use case class diagrams– Further analysis

Software Systems

Design - 4 4

Positioning in the design thread

• Part 4 (this lecture) gives a more structured approach to deriving a class diagram.

• However, it’s hard to apply if have no experience with class diagrams

• Therefore we did Part 3 (static class diagrams) first, so that you have some idea about the entity classed that could be involved.

Software Systems

Design - 4 5

Agate Ltd. (Case A in Bennett et al.)

• Agate Ltd. runs publicity campaigns.• For one client there can be multiple campaings• Each campaign consists of a number of different

clients

Software Systems

Client Campaign Advert1 * 1 *

Design - 4 6

Use case

• Adding a new advert to a campaign

Software SystemsBennett Fig. 7.13

Design - 4 7

A Collaboration

Software SystemsBennett Fig. 7.15

Design - 4 8

A Collaboration

Software Systems

Boundary object

Control object

Entity objects

Design - 4 9

BCE Objects/Classes

• Boundary object: provides interface with the outside world

• Control object: implements the logic involved in realising this use case

• Entity object: ‘regular’ object inside the systems

Software Systems

Design - 4 10

Communication diagram (1)

Software SystemsBennett Fig.7.16

Design - 4 11

Communication diagram (2)

Software SystemsBennett Fig. A3.2

Design - 4 12

Corresponding class diagram(use case class diagram)

Software SystemsBennett Fig. A3.3

Design - 4 13

Communication diagram notations (1)

• Standard Com.d. notation

• BCE notation

boundary / control / entity object

Software Systems

:Campaign

Design - 4 14

Communication diagram notations (2)

• *: loop; repeat message for all instances

• Sequential numbering of messages1, 2, 3, … n

• Hierachical numbering of messages• 3, 3.1, 3.1.1, 3.1.1.1, 3.1.1.2, 3.1.2, etc

Software Systems

Design - 4 15

BCE style with hierachical numbering

Software SystemsBennett Fig. A3.11

Design - 4 16

Use case class diagram

Software SystemsBennett Fig. A3.12

Design - 4 17

Other use case CDs (only entity classes)

Software SystemsFrom Bennett, Figs. 7.17, A.6

Design - 4 18Software Systems

Combined class diagram (“Analysis class diagram”)

Bennett Fig. A3.13

Design - 4 19

Overview of method1. For relevant use cases

1.1. Get extended use case description1.2. Design communication diagram1.3. Derive use case class diagram

2. Combine use case CD’s into analysis CD3. Improve analysis class diagram

3.1. Verify correctness (does is match the case description)

3.2. Add further details (data elements, further use cases)

Software Systems

Design - 4 20

Overview of method (contd.)

3.1. Verify correctness (does is match the case description)

We will do this in the lab exercise

3.2. Add further details (data elements, further use cases)

See Bennett for an example

Software Systems

Design - 4 21

Static vs. Dynamic Class diagrams

Static (D-3)• Abstracts from methods• More detailed

semantics of generalization

• A model of information about the real world that should be represented in the system

Dynamic (D-4)• Includes methods• Abstracts from data

types and generalization details

• Constructed by analysing how the system realizes various use cases

Software Systems

Design - 4 22

Exercise

• Service department of internetshop RedHot: handling of products that need repair

• If a product is broken, the customer calls the Customer Service. An employee creates a service record. The customer receives an e-mail with instructions for sending it in, and label for sending a parcel free of charge.

Software Systems

Design - 4 23

Draw comm. diagram for this use case

Software Systems

Actor action System response1 2 Displays list of customers3 Selects the customer 4 Displays products purcha-

sed by this customer

5 Selects product to be serviced

6 Creates service record

7 Enters problem descr. 8 Stores problem description

9 Creates customer instructions

10 Sends e-mail to customer

top related