31
02291: System Integration From Requirements To Design Hubert Baumeister [email protected] DTU Compute Technical University of Denmark Spring 2019

02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

02291: System IntegrationFrom Requirements To Design

Hubert [email protected]

DTU ComputeTechnical University of Denmark

Spring 2019

Page 2: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

From Requirements to Design

ProblemI Given a requirements model consisting of:

1 use case diagram2 detailed use case descriptions3 glossary4 non functional requirements

I how do I get a system design consisting ofa component diagramb class diagramc behaviour design

Page 3: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

From Requirements to Design: Solution

I Design process1 Define the basic architecture of the system2 The terms in the glossary give first candidates for classes,

attributes, and operations3 Realize one use case scenario / user story at a time

→ simulate execution→ CRC cards

Page 4: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Introduction CRC Cards

I Class Responsibility CollaborationI Developed in the 80’sI Used to

I Analyse a problem domainI Discover object-oriented designI Teach object-oriented design

I Object-oriented designI Objects have state and behaviourI ”Think objects”

Page 5: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

CRC Card Template

A larger exampleI http://c2.com/doc/crc/draw.html

Page 6: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Process

I Basic: Simulate the execution of use case scenarios / userstories

I Steps1. Brainstorm classes/objects/components2. Assign classes/objects/components to persons (group up to

6 peopel)4. Execute the scenarios one by one

a) add new classes/objects/components as neededb) add new responsibilitiesc) delegate to other classes / persons

Page 7: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: Problem Description and GlossaryI Problem Description

I Library system for checking out , returning, and searchingfor books. No more than 5 books can be loaned by oneborrower at a time. And if a book is returned after itsoverdue date, a fine has to be paid.

Glossary

I LibrarienI The object in the system that fulfills User requests to check

out, check in, and search for library materialsI Book

I The set of objects that represent Users who borrow itemsfrom the library

I BorrowerI The set of objects that represent Users who borrow items

from the libraryI . . .

Page 8: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: Problem Description and GlossaryI Problem Description

I Library system for checking out , returning, and searchingfor books. No more than 5 books can be loaned by oneborrower at a time. And if a book is returned after itsoverdue date, a fine has to be paid.

Glossary

I LibrarienI The object in the system that fulfills User requests to check

out, check in, and search for library materialsI Book

I The set of objects that represent Users who borrow itemsfrom the library

I BorrowerI The set of objects that represent Users who borrow items

from the libraryI . . .

Page 9: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: Use Case Diagram

I Use Cases

User

LibrarySystem

borrow book

return book

search for book

Page 10: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: Detailed Use Case Check Out Book

I Name: Check Out BookI Description: The user checks out a book from the libraryI Actor: UserI Main scenario:

1 A user presents a book for check-out at the check-outcounter

2 The system registers the loanI Alternative scenarios:

I The user already has 5 books borrowed2a The system denies the loan

I The user has one overdue book2b The system denies the loan

Page 11: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Example II

I Set of initial CRC cardsI Librarien

I The object in the system that fulfills User requests to checkout, check in, and search for library materials

I BorrowerI The set of objects that represent Users who borrow items

from the libraryI Book

I The set of objects that represent items to be borrowed fromthe library

I Use case Check out book main scenarioI ”What happens when Barbara Stewart, who has no

accrued fines and one outstanding book, not overdue,checks out a book entitled Effective C++ Strategies+?”

Page 12: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 13: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 14: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 15: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 16: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 17: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 18: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 19: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 20: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 21: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 22: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 23: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 24: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 25: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 26: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: CRC cards

Page 27: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Library Example: All CRC cards

Page 28: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Process: Next Steps

I Repeat the process with other scenarios→ completes the design

I Review the resultI Group cardsI Check cardsI Refactor

I Transfer the resultI UML class diagramI UML interaction diagrams

Page 29: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Example: Class Diagram (so far)

0..1 *

Borrower

canBorrow

Book

isOverduecheckOut(b:Borrower)calculateDueDate

Librarien

checkOutBook(b:Book)

Date

compare(d:Date)

* *

0..1 dueDate

Page 30: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Example: Sequence Diagram for Check-out book

Check Out Book Realization

Page 31: 02291: System Integration · CRC cards. Introduction CRC Cards I Class Responsibility Collaboration I Developed in the 80’s I Used to I Analyse a problem domain I Discover object-oriented

Summary

ProcessI Further scenarios give more detailI Repeat CRC process on a more detailed level

I e.g. to design database interaction, or user interfaceI Choose your level of abstraction and stay there

Alternative: Build sequence and class diagrams directly (the”modern” way)

I Danger: talk about the system instead of being part of thesystem

I Possible when object-oriented principles have beenlearned

I CRC cards help with object-oriented thinking