Title: Caso di studio Sistema Bancario
1Caso di studioSistema Bancario
Vallarino Paola
2Dove siamo
Posizione allinterno del ciclo di vita di COMET
User
Requirements Modeling
Analysis Modeling
Design Modeling
Throwaway Prototyping
Incremental Software Construction
Incremental Software Integration
Customer
System Testing
Incremental Prototyping
3Particolarità di questo caso di studio
- Il sistema bancario è un sistema client-server
quindi la divisione in sottosistemi è già stata
fatta nellAnaysis Modeling - sottosistema ATMClient
- sottosistema BankServer
4Fasi del Design in COMET
Eccezione per questo caso di studio
- 1? Sviluppo di un Consolidated Collaboration
Diagram. - 2? Divisione del sistema in sottosistemi e
definizione delle interfacce dei sottosistemi. - 3? Strutturazione in Task.
- 4? Progettazione delle Information Hiding
Classes. - 5? Sviluppo del Detailed Software Design.
5Indice
Argomenti trattati nel seminario
- Definizione delle interfacce dei sottosistemi
- Sottosistema ATMClient
- Consolidated Collaboration model
- Refined Static model
- Strutturazione in Tasks
- Information Hiding Classes
- Detailed Software Design
- Sottosistema BankServer
- Consolidated Collaboration model
- Refined Static model
- Strutturazione in Tasks
- Information Hiding Classes
- Configurazione del sistema
6I Sottosistemi
PIN Validation Withdraw Query Transfer Confirm Abo
rt
Definizione delle distributed message interfaces
ATMTransaction
ltltserver subsystemgtgt BankServer
ltltClient subsystemgtgt ATMClient
bankResponse
- La message Interface è una Tightly coupled
message communication con risposta. - I messaggi scambiati sono aggregate messages.
- IL server usa una coda FIFO per la gestione dei
messaggi provenienti da più client.
7Il sottosistema ATMClient
Consolidated Collaboration Model
- Il Consolidated Collaboration diagram per
lATMClient è il risultato dellunione (merge)
dei collaboration diagrams sviluppati nella fase
precedente per gli use cases - Client Validate PIN
- Client Withdraw Funds
- Client Transfer Funds
- Client Query Account
- Operator Add Cash, Startup, Shutdown
8Validate PIN collaboration diagram
subsystem BankServer
2.5 Validate PIN (customer Info)
asynchronous I/O device CardReader
2.6Valid Valid PIN
I/O device interface CardReader Interface
1.2 Card Inserted
1Card Reader input
1.1Card Input Data
state dependent control ATMControl
2.4 PIN Entered (Customer Info)
entity ATMCard
2.7 Update Status
2.1 Card Request
2.2Card Data
1.3 Get PIN 2.7 Display Menu
2 PIN input
entity ATM Transaction
user interface CustomerInterface
ATM Customer
1.4 Pin Prompt 2.8 Selection Menu
2.3 Customer Info
9Consolidated collaboration diagram (PIN Validate)
subsystem BankServer
external output device Cash Dispenser
ATM Transaction
Bank Responses
asynchronous I/O device CardReader
ltltoutput device interfacegtgt CashDipenser
Intreface
client subsystem ATMClient
Dispense Cash (Cash Details)
Dispenser Output
Card Inserted, Card Ejected, Card Confiscated
Card Reader input
I/O device interface CardReader Interface
Cash Withdrawal Amount
Cash Response
Card Reader Output
entity ATMCash
Eject, Confiscate
Cash Dispensed
Card Input Data
state dependent control ATMControl
Start Up, Closedown
Operator
Customer Events (Transaction Details)
Cash Added
Operator Input
entity ATMCard
user interface Operator Interface
Print Receipt
Update Transaction Status (Cash Details),
Update PIN Status
Operator Info
Card Request
ATM Customer
Card Data
Receipt Printed
Printer Output
Display Prompts
Customer Input
ltltoutput device interfacegtgt ReceiptPrinter
Interface
entity ATM Transaction
Transaction Data
user interface CustomerInterface
Customer Info
ltltexternal output devicegtgt Receipt Printer
Display Information
Transaction Request
Transaction Details
10Withdraw collaboration diagram
external output device Cash Dispenser
subsystem BankServer
3.9 Dispenser Output
ATM Transaction
asynchronous I/O device CardReader
Bank Responses
ltltoutput device interfacegtgt CashDipenser
Intreface
3.6 Dispense Cash (Cash Details)
I/O device interface CardReader Interface
3.8 Cash Response
3.18 Card Ejected
3.7 Cash Withdrawal Amount
3.17 Card Reader Output
entity ATMCash
3.16 Eject
3.10 Cash Dispensed
state dependent control ATMControl
3.3 Withdrawal Selected (Transaction Details)
ltltexternal output devicegtgt Receipt Printer
3.11 Print Receipt
3.6a Update Status (Cash Details)
3.4a Display Wait 3.11a Display Cash
Dispensed 3.19 Display Ejected
3.4a.1 Wait Prompt 3.11a.1 Cash Dispensed
Prompt 3.20 Cash Ejected Prompt
3.15 Receipt Printed
3.14 Printer Output
ltltoutput device interfacegtgt ReceiptPrinter
Interface
entity ATM Transaction
3.13Transaction Data
user interface CustomerInterface
3.1 Customer Selection
3 Selection Input
ATM Customer
3.12 Transaction Request
3.2 Transaction Details
11subsystem BankServer
Consolidated collaboration diagram (Withdraw
Funds)
external output device Cash Dispenser
ATM Transaction
Bank Responses
asynchronous I/O device CardReader
client subsystem ATMClient
ltltoutput device interfacegtgt CashDipenser
Intreface
Dispense Cash (Cash Details)
Dispenser Output
Card Inserted, Card Ejected, Card Confiscated
Card Reader input
I/O device interface CardReader Interface
Cash Withdrawal Amount
Cash Response
Card Reader Output
entity ATMCash
Eject, Confiscate
Cash Dispensed
Card Input Data
state dependent control ATMControl
Start Up, Closedown
Operator
Customer Events (Transaction Details)
Cash Added
Operator Input
entity ATMCard
user interface Operator Interface
Print Receipt
Update Transaction Status (Cash Details),
Update PIN Status
Operator Info
Card Request
ATM Customer
Card Data
Printer Output
Receipt Printed
Display Prompts
Customer Input
ltltoutput device interfacegtgt ReceiptPrinter
Interface
entity ATM Transaction
Transaction Data
user interface CustomerInterface
Customer Info
ltltexternal output devicegtgt Receipt Printer
Display Information
Transaction Request
Transaction Details
12note
subsystem BankServer
Consolidated collaboration diagram
external output device Cash Dispenser
ATM Transaction
Bank Responses
asynchronous I/O device CardReader
ltltoutput device interfacegtgt CashDipenser
Intreface
client subsystem ATMClient
Dispense Cash (Cash Details)
Dispenser Output
Card Inserted, Card Ejected, Card Confiscated
Card Reader input
I/O device interface CardReader Interface
Cash Withdrawal Amount
Cash Response
Card Reader Output
entity ATMCash
Eject, Confiscate
Cash Dispensed
Card Input Data
state dependent control ATMControl
Start Up, Closedown
Operator
Customer Events (Transaction Details)
Cash Added
Operator Input
entity ATMCard
user interface Operator Interface
Print Receipt
Update Transaction Status (Cash Details),
Update PIN Status
Operator Info
Card Request
ATM Customer
Card Data
Receipt Printed
Printer Output
Display Prompts
Customer Input
ltltoutput device interfacegtgt ReceiptPrinter
Interface
entity ATM Transaction
Transaction Data
user interface CustomerInterface
Customer Info
ltltexternal output devicegtgt Receipt Printer
Display Information
Transaction Request
Transaction Details
13Note
Consolidated Collaboration Diagram ATMClient
- ATMControl partecipa a tutte le collaborazioni
lato client - Alcuni messaggi sono aggregate messages
- Ad es.
- - CustomerEvents include
- - PINEntered
- - WithDrawalSelected
- - Display Prompts include
- - GetPIN, DisplayMenu
- - DisplayWait, DisplayCashDispensed,
DisplayEject - Il diagramma include tutte le alternative
sequences - Ad es. Confiscate e CardConfiscated sono
originati dalla sequenza alternativa in cui la
transazione non ha successo
14ATMClient
Refined Static Model
- NellAnalysis Modeling lo static model contiene
solo classi entity - ATMTransaction
- WithdrawalTransaction
- TransferTransaction
- PINValidation
- Sulla base del Consolidate Collaboration diagram
si sviluppa un Refined Static model che include
le classi da cui sono istanziati gli oggetti del
C.C.D
15Refined Static Model
note
Static model
ltltuser interfacegtgt Customer Interface
ltltdevice interfacegtgt CardReader Interface
ltltdevice interfacegtgt ReceiptPrinter Interface
ltltdevice interfacegtgt CashDispenser Interface
Update
Controls
Reads
Notifies
Dispenses
ltltentitygtgt ATMCard
ltltuser interfacegtgt Operator Interface
Startup, Close
ltltentitygtgt ATM Cash
ltltstate dependent controlgtgt ATMControl
Replenishes
Notifies
Controls
Updates
ltltentitygtgt ATM Transaction
Reads
Creates
Static model
Consol. Coll. Diagram
ltltentitygtgt Withdrawal Transaction
ltltentitygtgt Query Transaction
ltltentitygtgt Transfer Transaction
ltltentitygtgt PINValidation Transaction
16Note
Refined Static Model
- La direzione di navigabilità sul class diagram
riflette la direzione in cui gli oggetti
comunicano con gli altri nel consolidated
collaboration diagram
17ATMClient
Progettazione della Concurrent Task Architecture
- Per determinare i task del sottosistema
consideriamo i collaboration diagram
dellAnalysis Model, in particolare - PINValidate
- WithdrawFunds
- Per ognuno analizziamo la sequenza dei messaggi
scambiati tra gli oggetti
18Analisi del Validate PIN collaboration diagram
note
subsystem BankServer
2.5 Validate PIN (customer Info)
asynchronous I/O device CardReader
2.6Valid Valid PIN
I/O device interface CardReader Interface
1.2 Card Inserted
1Card Reader input
1.1Card Input Data
state dependent control ATMControl
2.4 PIN Entered (Customer Info)
entity ATMCard
2.7 Update Status
2.1 Card Request
2.2Card Data
1.3 Get PIN 2.7 Display Menu
2 PIN Input
entity ATM Transaction
user interface CustomerInterface
1.4 PIN Prompt 2.8 Selection Menu
ATM Customer
2.3 Customer Info
19Note
Analisi del PIN Validate Collaboration diagram
- CardReader Interface ---gt è un task, ha il
comportamento - allinizio loggetto è dormant
- viene attivato da un interrupt
- legge linput
- lo converte in un formato interno
- scrive i contenuti nellATMCard
- manda un CardInserted mess. allATMControl
- ATMCard ---gt è un data abstraction, non ha un
thread di controllo separato - ATMControl ---gt control task
- manda getPIN mess. a Customer Interface
- ATMTransaction ---gt è un data abstraction, non
ha un thread di controllo separato
20Intial Concurrent collaboration diagram (parziale)
subsystem BankServer
external output device Cash Dispenser
ATM Transaction
Bank Responses
asynchronous I/O device CardReader
ltltoutput device interfacegtgt CashDipenser
Intreface
client subsystem ATMClient
Dispense Cash (Cash Details)
Dispenser Output
Card Inserted, Card Ejected, Card Confiscated
Card Reader input
ltltasyncronous I/O device interface
CardReader Interface
Cash Withdrawal Amount
Cash Response
Card Reader Output
data abstraction ATMCash
Eject, Confiscate
Cash Dispensed
Card Input Data
state dependent control ATMControl
Start Up, Closedown
Operator
Customer Events (Transaction Details)
Cash Added
Operator Input
data abstraction ATMCard
user interface Operator Interface
Print Receipt
Update Transaction Status (Cash Details),
Update PIN Status
Operator Info
Card Request
ATM Customer
Card Data
Receipt Printed
Printer Output
Display Prompts
data abstraction ATM Transaction
Customer Input
ltltoutput device interfacegtgt ReceiptPrinter
Interface
Transaction Data
user interface CustomerInterface
Customer Info
ltltexternal output devicegtgt Receipt Printer
Display Information
Transaction Request
Transaction Details
21ATMClient
Analisi del Withdraw Funds Collaboration diagram
- Questo collaboration diagram ha molti oggetti in
comune con quello per PINvalidate. - In più ha
- Receipt Printer Interface
- Cash Dispenser Interface
- ATMCash
- Occorre analizzare lATMControl Statechart per
capire come ATMControl interagisce con Receipt
Printer Interface e Cash Dispenser Interface
22Analisi del Withdraw collaboration diagram
note
external output device Cash Dispenser
subsystem BankServer
3.9 Dispenser Output
asynchronous I/O device CardReader
ATM Transaction
Bank Responses
ltltoutput device interfacegtgt CashDipenser
Interface
3.6 Dispense Cash (Cash Details)
I/O device interface CardReader Interface
3.8 Cash Response
3.18 Card Ejected
3.7 Cash Withdrawal Amount
3.17 Card Reader Output
entity ATMCash
3.16 Eject
3.10 Cash Dispensed
state dependent control ATMControl
3.3 Withdrawal Selected (Transaction Details)
ltltexternal output devicegtgt Receipt Printer
3.11 Print Receipt
3.6a Update Status (Cash Details)
3.4a Display Wait 3.11a Display Cash
Dispensed 3.19 Display Ejected
3.4a.1 Wait Prompt 3.11a.1 Cash Dispensed
Prompt 3.20 Cash Ejected Prompt
3.15 Receipt Printed
3.14 Printer Output
ltltoutput device interfacegtgt ReceiptPrinter
Interface
entity ATM Transaction
3.13 Transaction Data
user interface CustomerInterface
3.1 Customer Selection
3 Selection Input
ATM Customer
3.12 Transaction Request
3.2 Transaction Details
statechart
23Note
Analisi del Withdraw Funds Collaboration diagram
- Il Cash Dispenser è un output device passivo -gt
non ha bisogno di un task separato. - Non è possibile che lATMControl e il Cash
Dispenser siano in esecuzione contemporaneamente
perché il solo modo per lATMControl di lasciare
lo stato dispensing (vedere statechart) è
ricevere un messaggio dal Cash Dispenser. - Perciò il Cash Dispenser può essere combinato con
lATMControl secondo il principio del control
clustering. - Un ragionamento analogo può essere fatto per
lATMCash. - Si ottiene un unico task ATMController
24Statechart for ATMControl (partial)
Closed Down Entry/Diplay System Down
Receipt Printed / Eject
Ejecting
Printing
Cash Dispensed / Print Receipt
Dispensing
Processing Withdrawal
Insufficient Cash/ Eject
Withdrawal OK / Dispense Cash
25Initial concurrent collaboration diagram
subsystem BankServer
ATM Transaction
Bank Responses
Dispenser Output
client subsystem ATMClient
passive output device Cash Dispenser
Card Reader Input
Card Inserted, Card Ejected, Card Confiscated
Cash Withdrawal Amount
asynchronous I/O device CardReader
asynchronous I/O device interface
CardReader Interface
data abstraction ATMCash
Card Reader Output
Cash Response
Eject, Confiscate
Cash Added
Card Input Data
control clustering ATMController
Update Transaction Status(Cash Details), Update
PIN Status, Transaction Request
Customer Event (transaction Details)
Start Up, Closedown
Operator Input
data abstraction ATMCard
user interface Operator Interface
Transaction Data
Operator Info
Card Request
Card Data
Operator
Display Prompts
Customer Input
user interface CustomerInterface
Customer Info
data abstraction ATM Transaction
ATM Customer
Display Information
Transaction Details
26Initial concurrent collaboration diagram
note
subsystem BankServer
ATM Transaction
Bank Responses
Dispenser Output
client subsystem ATMClient
passive output device Cash Dispenser
Card Reader Input
Card Inserted, Card Ejected, Card Confiscated
Cash Withdrawal Amount
asynchronous I/O device CardReader
asynchronous I/O device interface
CardReader Interface
data abstraction ATMCash
Card Reader Output
Cash Response
Eject, Confiscate
Cash Added
Card Input Data
control clustering ATMControl
Update Transaction Status(Cash Details), Update
PIN Status, Transaction Request
Customer Event (transaction Details)
Start Up, Closedown
Operator Input
data abstraction ATMCard
user interface Operator Interface
Transaction Data
Operator Info
Operator
Card Data
Card Request
Display Prompts
Customer Input
user interface CustomerInterface
Customer Info
data abstraction ATM Transaction
ATM Customer
Display Information
Transaction Details
27Note
Concurrent Collaboration Diagram - Operator
Interface
- LOperator user interface è un task poiché ha
bisogno di un suo thread di controllo separato. - LATM Cash invece è di tipo data abstraction
- N.B. Non sono disponibili i collaboration
diagrams che coinvolgono loperatore!
28ATMClient
Definizione delle Task Interfaces
- Loggetto ATMController Task comunica con tutti i
task nel sottosistema ATMClient. - In particolare vediamo le interfacce della
comunicazione tra lATMController e - Customer Interface
- CardReader Interface
- Tutte le interfacce vengono raffigurate in un
Revised Concurrent Collaboration Diagram
29note
Revised concurrent collaboration diagram
subsystem BankServer
passive output device Cash Dispenser
ATM Transaction
Bank Responses
Dispenser Output
client subsystem ATMClient
Card Reader Input
Withdraw Cash (in cash Amount, out fivesTo
Dispense, out tenTo Dispense, out
twenties To Dispense)
Card Inserted, Card Ejected, Card Confiscated
asynchronous I/O device CardReader
asynchronous I/O device interface
CardReader Interface
data abstraction ATMCash
Card Reader Output
Eject, Confiscate
Addcash (in fivesAdded, in tenAdded, in
twentiesAdded)
write (card Data)
control clustering ATMController
Update Transaction Status(Cash Details), Update
PIN Status, read(out Transaction Data)
Customer Event (transaction Details)
Start Up, Closedown
Operator Input
data abstraction ATMCard
user interface Operator Interface
Display Prompts
Operator Info
Operator
read(out Card Data)
updateCustomerInfo (cardData, PIN), updateCustomer
Selection (in selection, out transactionDetails)
Customer Input
user interface CustomerInterface
data abstraction ATM Transaction
ATM Customer
Display Information
30Note
- Linterfaccia tra ATMController e
CustomerInterface deve essere loosely coupled
perché - dopo aver mandato una richiesta al controller la
customer interface non può bloccarsi perché deve
poter ricevere operazioni di annullamento dal
customer
31Revised concurrent collaboration diagram
note
subsystem BankServer
passive output device Cash Dispenser
ATM Transaction
Bank Responses
Dispenser Output
client subsystem ATMClient
Card Reader Input
Withdraw Cash (in cash Amount, out fivesTo
Dispense, out tenTo Dispense, out
twenties To Dispense)
Card Inserted, Card Ejected, Card Confiscated
asynchronous I/O device CardReader
asynchronous I/O device interface
CardReader Interface
data abstraction ATMCash
Card Reader Output
Eject, Confiscate
Addcash (in fivesAdded, in tenAdded, in
twentiesAdded)
write (card Data)
control clustering ATMController
Update Transaction Status(Cash Details), Update
PIN Status, read(out Transaction Data)
Customer Event (transaction Details)
Start Up, Closedown
Operator Input
data abstraction ATMCard
user interface Operator Interface
Display Prompts
Operator Info
Operator
read(out Card Data)
updateCustomerInfo (cardData, PIN), updateCustomer
Selection (in selection, out transactionDetails)
Customer Input
user interface CustomerInterface
data abstraction ATM Transaction
ATM Customer
Display Information
32Note
- ATMControl manda un messaggio di Eject o
Confiscate al CardReader Interface Task. - Questa comunicazione è tightly coupled perché,
dopo aver spedito il messaggio allATMController,
la CardReaderInterface aspetta un messaggio di
ritorno di tipo Eject o Confiscate.
33ATMClient
Information Hiding classes
- data abstraction classes
- ATMTransaction
- device interface classes
- ReceiptPrinterInterface
- CashDispenserInterface
- state dependent control class
- ATMControl
34ATMClient
ATMTransaction Information Hiding Class
ltltdata abstractiongtgt ATMTransaction -
transactionID String -
cardID String
- PIN String null
- selection TransactionType -
transactionData TransactionRecord
updateCustomerInfo (cardData,PIN)
updateCustomerSelection (in selection, out
transactionDetails) updatePINStatus (status)
updateTransactionStatus
(cashDetails) read (out transactionData)
35ATMClient
ATMControl Information Hiding Class
ltltstate dependent controlgtgt ATMcontrol
processEvent (in event,out action) currentState
() State
36Task Behaviour Specifications
- Per documentare i task
- si sviluppa una Task Behaviour Specification
(TBS) per ogni Task - Ad es.
- TBS per CardReader Interface
37Task Behaviour Specifications
- Una Task Behavior Specification (TBS) descrive
linterfaccia, la struttura, le caratteristiche
temporali, la priorità relativa, la event
sequencing logic e gli errori rilevati di un
task. - Le TBSs si sviluppano durante la task
architecture, tranne levent sequencing logic che
viene rimandata al detailed software design.
38TBS
Card Reader Interface Task
- 1. Interfaccia del task
- Input
- Eventi Card reader external interrupt to
indicate that a card has been input. - Input esterni cardReaderInput
- Tightly coupled message communication
- Eject,confiscate
- Output
- Output esterni cardReaderInput
- Loosely coupled message communication
- cardInserted, cardEjected, cardConfiscated
- Passive object acceduti ATMCard
39TBS
Card Reader Interface Task
- 2. Struttura del task
- Criterio Asynchronous Input Device Interface
- Oggetti mappati nel task
- cardReaderInterface
- 3.Caratteristiche temporali
- Attivazione Asynchronous-from external card
reader. - Worst case inter-arrival time 500 msec.
- Average inter-arrival time gt 5 minutes.
- Tempo di esecuzione Ci 5ms per message
40TBS
Card Reader Interface Task
- 4.Priorità del task
- High-Needs to be responsive to incoming cards.
- 5.Errori riscontrati
- Unrecognized card. Card reader malfunction
- 6.Event sequence logic
- Rimandato alla fase di detailed software design
41ATMClient
Sviluppo del Detailed Software Design
- LATMController ha una loosely coupled message
comunication interface attraverso cui riceve i
messaggi. - Il meccanismo di comunicazione viene incapsulato
in un Connettore ( ATMControl Message Queue)
42Detailed software design of ATM Controller
(Design of ATMController connectors)
note
receive (out cardreaderMsg)
ltltAsyncronous I/O device interfacegtgt CardReader
Interface
ltltconnectorgtgt CardReader MessageBuffer
ltltconnectorgtgt bankServer Proxy
send (in ATMControlRequest)
send (in ATMTransaction, out bankResponse)
send (in cardreaderMsg)
send (in ATMControl Request)
ltltconnectorgtgt ATMControl MessageQ
ltltcontrol clusteringgtgt ATMController
ltltuser interfacegtgt Operator Interface
receive (out ATMControlRequest)
send (in ATMControlRequest)
send (in displayPrompt)
receive (out displayPrompt)
ltltconnectorgtgt promptMessage Queue
ltltuser interfacegtgt Customer Interface
43Note
Connettori
- ATMControl Message Queue
- Card Reader, Operator e Customer Interface sono
tutti task produttori che chiamano loperazione
send del connettore Message Queue. - Il connettore Message Queue mantiene una coda
FIFO dei messaggi diretti allATMController - Prompt Message Queue
- loosely coupled
- serve allATMController per mandare messaggi di
Display Prompt a Customer Interface.
Continua
44Note
Connettori
- Card Reader Message Buffer
- tightly coupled
- serve allATMController per mandare i messaggi
Eject o Confiscate a Card Reader Interface - Bank Server Proxy
- ATTIVO per nascondere i dettagli della
comunicazione con il Bank server remoto
(comunicazione sincrona con risposta) - Ad es. in Java si implementerebbe con una Remote
Method Invocation Interface
45ATMClient
Detailed Software Design
- LATM Controller è un task che ha al suo interno
oggetti passivi - Occorre definire la sua struttura interna
- Coordinator object
- ATMControl
- CashDispenser Interface
- ReceiptPrinter Interface
46Detailed software design of ATM Controller
(Internal Design of ATMController)
note
statechart
send (in ATMTransaction, out bankResponse
send (in cardReader msg)
printer Output
ltltcontrol clusteringgtgt ATMController
ltltoutput device interfacegtgt ReceiptPrinter
Interface
printReceipt (in receiptInfo, out printStatus)
receive (out ATMControl Request)
ltltcoordinatorgtgt ATMCoordinator
dispenseCash (in cashAmount, out
dispenseStatus)
read (out transaction data)
processEvent (in event, out action)
ltltoutput device interfacegtgt CashDispenser
Interface
send (in display Prompt)
ltltstate dependent controlgtgt ATMControl
updateTransaction (cashDetails), updatePINStatus
(status)
Dispenser Output
47Note
Struttura interna dellATMController
- Coordinator Object
- riceve i messaggi in arrivo allATM Controller
- coordina lesecuzione degli altri tre oggetti
interni - ATMControl
- incapsula lATMStatechart (implementato come una
state transition table)
48ATMClient
Detailed Software Design
- Le TBSs vengono completate con lo sviluppo delle
Task Event Sequencing Logic - Ad es.
- CardReader Interface Task Event Sequencing Logic
- ATMContol Task Event Sequencing Logic
-
49Task Event sequencing Logic
Card Reader Interface Task
-- Inizialize Card Reader cardReaderDI.inizializ
e() loop --Wait for external interrupt from card
reader wait (cardReaderEvent) --Read card data
held on cards magnetic strip cardReaderDI.read
(cardInput) if card recognized then ...
- Il Card Reader Interface Task è svegliato da un
evento esterno, legge la carta,...
50ATMClient
ATMController Task Behaviour Specification
- ATMController Task
- CashDispenserInterface e ReceiptPrinterInterface
sono oggetti contenuti nello stesso task - quindi
- le azioni dispenseCash e printReceipt sono
tradotte come semplici chiamate di funzioni.
51Il sottosistema BankServer
Consolidate Collaboration Diagram
- Il Consolidated Collaboration diagram per il
sottosistema BankServer è il risultato
dellunione (merge) dei collaboration diagram
sviluppati per gli use cases - Server Validate PIN
- Server Withdraw Funds
- Server Transfer Funds
- Server Query Account
52Server ValidatePIN collaboration diagram
indietro
ltltsubsistemgtgt ATMClient
V1 PINValidation Request (CardID, PIN)
V6 PINValidation Response (Status)
ltltbusiness logicgtgt PINValidation
TransactionManager
V5 Account Numbers
V2Validate (CardID, PIN)
V3 Card Data
V4 Read (CardID)
ltltentitygtgt Card Account
ltltentitygtgt Debit Card
53Server WithdrawFunds collaboration diagram
indietro
ltltsubsistemgtgt ATMClient
W1 Withdrawal Request (Transaction Details)
W8 Withdrawal Response (Cash Details)
ltltbusiness logicgtgt Withdrawal TransactionManager
W2 Check Daily Limit (cardId, Amount)
W4 Debit (Account, Amount)
W2 Update Daily Total (cardId, Amount)
W7 Log Transaction
W3 Daily Limit Response
W5 Account Data
ltlt entity gtgt Debit Card
ltlt entity gtgt Transaction Log
ltlt entity gtgt Account
54ATM Transaction
Consolidated collaboration diagram
ltltsubsistemgtgt ATMClient
note
bankResponse
ltltserver subsystemgtgt BankServer
ltltcoordinatorgtgt BankTransactionServer
Transfer Response
PINValidation Request
Withdraw, Confirm, Abort
Query Transaction
Query Response
Withdraw Response
Transfer Transaction
PINValidation Response
ltltbusiness logicgtgt PINValidation
TransactionManager
ltltbusiness logicgtgt Withdrawal TransactionManager
ltltbusiness logicgtgt Transfer TransactionManager
ltltbusiness logicgtgt Query TransactionManager
ltltentitygtgt Checking Account
ltlt entity gtgt Transaction Log
ltlt entity gtgt Savings Account
ltltentitygtgt Card Account
ltltentitygtgt Debit Card
55ATM Transaction
Consolidated collaboration diagram (Zoom)
ltltsubsistemgtgt ATMClient
indietro
bankResponse
ltltserver subsystemgtgt BankServer
ltltcoordinatorgtgt BankTransactionServer
Transfer Response
PINValidation Request
Withdraw, Confirm, Abort
Query Transaction
Query Response
Withdraw Response
Transfer Transaction
PINValidation Response
ltltbusiness logicgtgt PINValidation
TransactionManager
ltltbusiness logicgtgt Withdrawal TransactionManager
ltltbusiness logicgtgt Transfer TransactionManager
ltltbusiness logicgtgt Query TransactionManager
...
...
...
Credit, Debit, Read
Daily Limit Response
Account Data
Account Data
Check, Update
Log
Credit, Debit, Read
ltlt entity gtgt Checking Account
ltlt entity gtgt Transaction Log
ltlt entity gtgt Savings Account
ltltentitygtgt Debit Card
56ATM Transaction
Consolidated collaboration diagram (Zoom)
ltltsubsistemgtgt ATMClient
indietro
bankResponse
ltltserver subsystemgtgt BankServer
ltltcoordinatorgtgt BankTransactionServer
Transfer Response
PINValidation Request
Withdraw, Confirm, Abort
Query Transaction
Query Response
Withdraw Response
Transfer Transaction
PINValidation Response
ltltbusiness logicgtgt PINValidation
TransactionManager
ltltbusiness logicgtgt Withdrawal TransactionManager
ltltbusiness logicgtgt Transfer TransactionManager
ltltbusiness logicgtgt Query TransactionManager
...
...
...
Read
Read
Account Data
Account Data
Log
ltltentitygtgt Checking Account
ltlt entity gtgt Transaction Log
ltlt entity gtgt Savings Account
57ATM Transaction
Consolidated collaboration diagram (Zoom)
ltltsubsistemgtgt ATMClient
indietro
bankResponse
ltltserver subsystemgtgt BankServer
ltltcoordinatorgtgt BankTransactionServer
Transfer Response
PINValidation Request
Withdraw, Confirm, Abort
Query Transaction
Query Response
Withdraw Response
Transfer Transaction
PINValidation Response
ltltbusiness logicgtgt PINValidation
TransactionManager
ltltbusiness logicgtgt Withdrawal TransactionManager
ltltbusiness logicgtgt Transfer TransactionManager
ltltbusiness logicgtgt Query TransactionManager
...
...
Read
Validate
Credit, Debit, Read
Account Data
Card Data
Credit, Debit, Read
Account Numbers
Log
ltltentitygtgt Checking Account
ltlt entity gtgt Transaction Log
ltlt entity gtgt Savings Account
ltltentitygtgt Card Account
ltltentitygtgt Debit Card
58Note
Consolidated Collaboration diagram per il Bank
Server
- Per ogni transazione cè un Transaction Manager
object che incapsula la business logic per la
transazione - Coordinator object
- riceve le richieste dai client
- delega le richieste al Transaction Manager
appropriato - Problema i messaggi dal Withdrawal Transaction
Manager agli Account possono essere Credit e Read?
59BankServer
Refined Static Model
- Alcune classi del Conceptual Static Model
risiedono nel Bank Server - Account, Customer, Bank, ATMInfo, Card Account,
Debit Card - Dal Consolidate Collaboration diagram si
ottengono le classi da cui sono istanziati gli
oggetti del diagramma - BankTransactionServer, i 4 Transaction Manager,
Transaction Log
60Conceptual static Model for problem domain
1 Mantains ? 1
ltlt entity gtgt Bank
ltlt entity gtgt ATMInfo
1
1
Has ?
Manages ?
1..
ltlt entity gtgt Customer
Owns ?
Identifies ?
1..
1..
0..1
Owns ?
ltltentitygtgt Debit Card
Provides access to ?
1..
1..
ltltentitygtgt Card Account
? Modifies
ltlt entity gtgt Account
ltlt entity gtgt Transaction
1,2
ltltentitygtgt Checking Account
ltlt entity gtgt Savings Account
ltlt entity gtgt Withdrawal Transaction
ltlt entity gtgt Query Transaction
ltlt entity gtgt Transfer Transaction
ltlt entity gtgt PINValidation Transaction
61Refined Static Model
ltltcoordinatorgtgt BankTransaction Server
note
Delegates to
Delegates to
Delegates to
Delegates to
ltltbusiness logicgtgt PINValidation
TransactionManager
ltltbusiness logicgtgt Withdrawal TransactionManager
ltltbusiness logicgtgt Query TransactionManager
ltltbusiness logicgtgt Transfer TransactionManager
Checks, Updates
Credits, Debits, Reads
Reads
Credits, Debits, Reads
Queries
Credits, Debits, Reads
Validates
Reads
Logs
Logs
Credits, Debits, Reads
ltltentitygtgt Debit Card
ltltentitygtgt Card Account
Logs
ltlt entity gtgt Savings Account
ltltentitygtgt Checking Account
ltlt entity gtgt Transaction Log
Manages
Owns
ltltentitygtgt Account
ltltentitygtgt Bank
ltltentitygtgt Customer
Has
Owns
ltltentitygtgt ATMInfo
Provides Access to
62Note
Refined Static Model per il Bank Server
- La direzione di navigabilità nel class diagram
riflette la direzione in cui avvengono le
comunicazioni tra gli oggetti nel Consolidate
collaboration diagram
63BankServer
Concurrent Task Architecture
- Il BankServer contiene il Database Centralizzato
del sistema bancario - Business Decision le entity classes nel server
devono essere memorizzate come relazioni (flat
files) di un database relazionale. - Queste classi incapsuleranno le interfaccie per
il database e saranno ltltdatabase wrapper classesgtgt
64BankServer
Concurrent Tasks Architecture
- Decisione usare un server sequenziale (ogni
transazione è messa in una coda FIFO e aspetta la
fine della precedente per essere attivata) - Con questa scelta il server risulta essere un
unico task (un unico thread di controllo)
65Initial concurrent collaboration diagram
ATM Transaction
ltltsubsistemgtgt ATMClient
note
bankResponse
ltltserver subsystemgtgt BankServer
ltltcoordinatorgtgt BankTransactionServer
Transfer Response
PINValidation Request
Withdraw, Confirm, Abort
Query Transaction
Query Response
Withdraw Response
Transfer Transaction
PINValidation Response
ltltbusiness logicgtgt PINValidation
TransactionManager
ltltbusiness logicgtgt Withdrawal TransactionManager
ltltbusiness logicgtgt Transfer TransactionManager
ltltbusiness logicgtgt Query TransactionManager
Credit, Debit, Read
Card Data
Validate
Credit, Debit, Read
Read
Account Data
Account Data
Account Numbers
Log
Log
Log
ltltdatabase wrappergtgt Checking Account
ltltdatabase wrappergtgt Transaction Log
ltltdatabase wrappergtgt Savings Account
ltltdatabase wrappergtgt Debit Card
ltltdatabase wrappergtgt Card Account
66Note
Task Architecture per il Bank Server
- Tutti gli oggetti allinterno del sottosistema
BankServer sono passivi. - Le entità sono diventate databasewrapper perché
sono interfacce verso il database centralizzato
del sistema bancario. - Le database wrapper classes, quindi, non
contengono dati. Al contrario delle data
abstraction classes usate nellATMClient.
67Information Hiding Classes
- ltltbusiness logicgtgt
- WithdrawalTransactionManager
- PinValidationTransactionManager
- QueryTransactionManager
- TransfeTransactionManager
- ltltdatabase wrappergtgt
- CardAccount
- TransactionLog
- DebitCard
- Account ( Cheking e Saving Account)
68BankServer
CardAccount Information Hiding Class
ltltdatabase wrappergtgt CardAccount read(in
cardID,out accountNumber) update (in
cardID, out accountNumber)
69BankServer
WithdrawalTransactionManager Information Hiding
Class
ltltbusiness logicgtgt WithdrawalTransactionManager
inizialize() withdraw (in accountNumber, in
amount, out w_response) confirm
(accountNumber, amount) abort (acountNumber,
amount)
70BankServer
Definizione delle Interfacce
- Ogni transazione è eseguita fino alla fine e
ritorna il risultato al BankTransaction Server - Le interfacce interne al sottosistema sono di
tipo sincrono (vengono definite in termini di
chiamate di operazioni)
71ATM Transaction
Revised concurrent collaboration diagram
ltltsubsistemgtgt ATMClient
note
bankResponse
ltltserver subsystemgtgt BankServer
ltltcoordinatorgtgt BankTransactionServer
validatePIN (in cardID, in PIN, out v_response)
transfer (in fromAccount, in toAccount, in
amount, out t_response)
withdraw (in account, in amount, out
w_response), confirm (account, amount), abort
(account, amount)
query (in account, out q_response)
ltltbusiness logicgtgt PINValidation
TransactionManager
ltltbusiness logicgtgt Withdrawal TransactionManager
ltltbusiness logicgtgt Transfer TransactionManager
ltltbusiness logicgtgt Query TransactionManager
ltltdatabase wrappergtgt Checking Account
ltltdatabase wrappergtgt Transaction Log
ltltdatabase wrappergtgt Savings Account
ltltdatabase wrappergtgt Debit Card
ltltdatabase wrappergtgt Card Account
72Note
Interfacce per il Bank Server
- Oltre alle interfacce, nel Revised Concurrent
Collaboration diagram vengono specificate le
operazioni e i loro attributi
73ATM Transaction
Revised concurrent collaboration diagram (zoom)
ltltsubsistemgtgt ATMClient
bankResponse
ltltserver subsystemgtgt BankServer
ltltcoordinatorgtgt BankTransactionServer
transfer (in fromAccount, in toAccount, in
amount, out t_response)
...
ltltbusiness logicgtgt Transfer TransactionManager
debit (account, amount), credit
(account, amount), readBalance
debit (account, amount), credit (account,
amount), readBalance
debit (account, amount), credit (account,
amount), readBalance
ltltdatabase wrappergtgt Checking Account
ltltdatabase wrappergtgt Savings Account
ltltdatabase wrappergtgt Transaction Log
74ATM Transaction
Revised concurrent collaboration diagram (zoom)
ltltsubsistemgtgt ATMClient
bankResponse
ltltserver subsystemgtgt BankServer
ltltcoordinatorgtgt BankTransactionServer
query (in account, out q_response)
...
...
ltltbusiness logicgtgt Query TransactionManager
readBalance, readCumulative Interest
readBalance, readLast Deposit Amount
log (in transaction)
ltltdatabase wrappergtgt Checking Account
ltltdatabase wrappergtgt Savings Account
ltltdatabase wrappergtgt Transaction Log
75ATM Transaction
Revised concurrent collaboration diagram (zoom)
ltltsubsistemgtgt ATMClient
bankResponse
ltltserver subsystemgtgt BankServer
ltltcoordinatorgtgt BankTransactionServer
withdraw (in account, in amount, out
w_response), confirm
(account, amount), abort (account, amount)
...
ltltbusiness logicgtgt Withdrawal TransactionManager
checkDaily Limit (cardID, amount), updateDaily
Total (cardID, amount)
...
Debit (account, amount), credit (account,
amount), readBalance
log (in transaction)
log (in transaction)
ltltdatabase wrappergtgt Checking Account
ltltdatabase wrappergtgt Transaction Log
ltltdatabase wrappergtgt Savings Account
ltltdatabase wrappergtgt Debit Card
76ATM Transaction
Revised concurrent collaboration diagram (zoom)
ltltsubsistemgtgt ATMClient
bankResponse
ltltserver subsystemgtgt BankServer
ltltcoordinatorgtgt BankTransactionServer
validatePIN (in cardID, in PIN, out
v_response)
ltltbusiness logicgtgt PINValidation
TransactionManager
...
read (in cardID, out account)
Validate (cardID, PIN)
ltltdatabase wrappergtgt Debit Card
ltltdatabase wrappergtgt Card Account
77BankServer
Detailed Software Design
- Event Sequencing Logic
- per il BankServer Task
78Configurazione del sistema bancario
- Sistema client-server gt istanze multiple del
sottosistema client e una istanza del sistema
server - Ogni istanza viene eseguita sul suo nodo
ATMClient 1 node per ATM
BankServer 1 node
ltltwide area networkgtgt
Deployment diagram
79Alternativa
- Usare un server concorrente anziché un
server sequenziale - Differenza nella Task Architecture
- il BankTransactionServer e gli oggetti ltltbusiness
logicgtgt sono progettati come task separati