Drexel University
CS 451 Software Engineering
1
CS 451 Software Engineering Yuanfang Cai Room 104, University - - PowerPoint PPT Presentation
CS 451 Software Engineering Yuanfang Cai Room 104, University Crossings 215.895.0298 yfcai@cs.drexel.edu 1 Drexel University Design Engineering A systematical way to translate SRS into design Start with use cases from SRS
Drexel University
1
Drexel University
A systematical way to “translate” SRS into
Create CRC cards from use cases
Refine CRC cards into UML class diagrams
Different types of classes
2
Drexel University
Step 1: Identify and assign candidate classes Step 2: Determine a set of specific scenarios Step 3: Walk through the scenario, naming cards
3
Drexel University
Read requirements specification. Highlight nouns and noun phrases to give
Write each candidate class down on an index
Assign each index card to one person who is
Drexel University
Example: any ATM model will involve Card,
Names are important.
noun identification; responsibility driven approach.
5
Drexel University
Two stages:
identify candidate classes by picking all nouns and noun phrases out of
requirements specification document;
discard inappropriate candidates.
A candidate is an inappropriate class when it is
redundant (ex: book, book in many volumes; member of the
library,library member)
vague (item it may be either book or journal etc) an event or an operation (a loan – an event: lending a book) meta-language element: used to describe and explain requirements
and the system at a very high level (system, rule, information, or reporting requirements)
outside the scope of the system (time) an attribute (name) Nouns are outlined
6
Drexel University
See Class Exercise
7
Drexel University
8
Drexel University
Class candidates:
card bank account (ATM) dispenser & session – vague (it might become of interest)
Data associated
PIN - attribute of card current balance - attribute of bank account amount – attribute in various classes overdraft limit – attribute of bank account card limit per day – attribute of card dispenser amount – attribute of ATM dispenser
9
Drexel University
10
Drexel University
11
Drexel University
Card class’ attributes and operations; validatePIN() validates the PIN introduced against the value in pin; changePIN() changes the current pin value with what this operation provides; startWithdraw() initiates the withdrawal by i) checking that the amount requested is within dayLimit range; ii) checks with BankAccount that there is enough in the current bank account or the overdraft limit is sufficient for this transaction; iii) it also checks that there is enough cash in dispenser; if all these are fulfilled it asks BankAccount to update the balance and Dispenser to release the cash.
12
Drexel University
13
Drexel University
14
Drexel University
15
Drexel University
Let’s consider that transactions involving cash withdrawal, either
failed or successful, are recorded. In this case
session (retained as vague) will be reconsidered and Transaction is
the class that will be identified for session.
Reconsider CRC cards: when Card class will initiate cash
withdrawal then another collaboration will be added, i.e. Transaction class will record this transaction.
A new CRC card will be then generated for Transaction class.
16
Drexel University
17
Drexel University
Class diagrams is obtained directly from CRC cards by
Classes are shown with no attributes and operations.
18
Drexel University
For each Card there is one bank account, one dispenser and an
arbitrary number of transactions.
Each BankAccount should have one or more cards associated with. The Dispenser refers to all cards. Each Transaction has a unique card on it. All associations are named, directed and unidirectional.
19
Drexel University
Entity Class
Data Structures: e.g. Card,
Process Class
Classes that work: Transactions
Boundary Class
Interface with external systems: Dispenser
20