02291: system integration · crc cards. introduction crc cards i class responsibility collaboration...
TRANSCRIPT
![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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/1.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/2.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/3.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/4.jpg)
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 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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/6.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/7.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/8.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/9.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/10.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/11.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/12.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/13.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/14.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/15.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/16.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/17.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/18.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/19.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/20.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/21.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/22.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/23.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/24.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/25.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/26.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/27.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/28.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/29.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/30.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022053008/5f0bd9f87e708231d432871b/html5/thumbnails/31.jpg)
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