0% found this document useful (0 votes)
17 views

Software Engineering - Module6 Exercises (Sequence Diagrams and Design Code)

The document provides details of assignments for a software engineering module. It includes sequence diagrams and code for a rock-paper-scissors game designed using the strategy pattern. Students are asked comprehension questions about strategy design, participants in the diagrams, strategy responsibilities and methods, concrete strategies used, notation in the diagrams, and matching code to diagram messages.

Uploaded by

GerardAlba
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Software Engineering - Module6 Exercises (Sequence Diagrams and Design Code)

The document provides details of assignments for a software engineering module. It includes sequence diagrams and code for a rock-paper-scissors game designed using the strategy pattern. Students are asked comprehension questions about strategy design, participants in the diagrams, strategy responsibilities and methods, concrete strategies used, notation in the diagrams, and matching code to diagram messages.

Uploaded by

GerardAlba
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Bàtxelor en Informàtica

M8 Software Engineering
Activities Availability date Due date
Module 6 10/05/2024 24/05/2024

Module 6 Assignments

Activity 1:

Name the numbered elements in this sequence diagram:

A: Lifeline
B: Interaction Message
C: Participant
D: Activation bar

Element Name

1 C

Consell de la Qualitat de la Universitat d’Andorra


Bàtxelor en Informàtica
M8 Software Engineering

Activity 2:

Let’s consider an online bookstore, as described by the following sequence diagram. You have to
choose the answer (I-IV) that shows the right time ordering of the steps A-F, according to the
diagram:

A: The system will return all books with that title.


B: The customer can repeat the interaction as many times as desired.
C: The customer begins the interaction by searching for a book by title.
D: The customer can purchase the items in the cart by checking out.

E: The customer can place a book in the shopping cart.


F: The customer can look at the book description.

I. C, A, F, E, D, B
II. C, A, B, F, E, D
III. A, B, C, D, E, F
IV. A, C, B, D, E, F

Consell de la Qualitat de la Universitat d’Andorra


Bàtxelor en Informàtica
M8 Software Engineering

Activity 3:

Which of the following are good reasons to make a sequence diagram before starting to code?

A: Sequence diagrams are language-agnostic (can be implemented in many different languages)


B: Non-coders can read and write sequence diagrams.
C: Easier to do sequence diagrams as a team (business and IT people team).
D: All of the above

Activity 4:

Please study the class and sequence diagrams, and the Python code below, that describe the design
using a strategy pattern for the rock-scissors-paper game.

Consell de la Qualitat de la Universitat d’Andorra


Bàtxelor en Informàtica
M8 Software Engineering

Consell de la Qualitat de la Universitat d’Andorra


Bàtxelor en Informàtica
M8 Software Engineering

Consell de la Qualitat de la Universitat d’Andorra


Bàtxelor en Informàtica
M8 Software Engineering

Consell de la Qualitat de la Universitat d’Andorra


Bàtxelor en Informàtica
M8 Software Engineering

Consell de la Qualitat de la Universitat d’Andorra


Bàtxelor en Informàtica
M8 Software Engineering

Now, answer the following questions:


1. Briefly explain why using a strategy design pattern for this problem (game programming) is a
good solution.
2. Who are the participants in the sequence diagram?
3. What are the responsibilities and methods assigned to the concrete strategies objects,
according to the diagrams?
4. Which are the concrete strategies of the design pattern choosen for each player?
5. Why are the initial messages of the sequence diagram shown as dotted arrows?
6. Consider the loop block of the sequence diagram. Explain the operations that take place, and
match these interaction messages with the corresponding code sections.

Consell de la Qualitat de la Universitat d’Andorra

You might also like