Prof Anil Thakur Session 3 Analysis Problem Analysis
Prof. Anil Thakur Session 3 Analysis Problem Analysis, Problem domain classes, Identify classes and objects of REAL WORLD, Problems Using use case Analysis, Recording Analysis.
Problem Analysis • Devising a precise, concise, understandable and correct model of the real world • Examine requirements, analyse their implication and restate them rigorously. • States what’s be done without saying how’s to be done • Result: Understanding the problem as a preparation for design.
Use Case driven OOA • The actors are the external factors that interact with system • Use case are scenarios that describe how actors use the system • OOA Steps – Identify the actors – Develop a simple business process model using UML activity diagram – Develop the use case – Prepare interactive diagrams – Classification-develop a static UML Class diagram – Iterate and refine
OOA in UA Identify actors Develop use cases, Develop interaction activity diagrams diagram Identify classes, relationships, Refine and attributes, and iterate methods Build prototype OOA Process in the UA
Activity Diagram Return Book ? Checking out books ? Y Go to counter Y And return The book Done ? Inter library load ? Y Y Borrow books N Y N Do reachers Y Go to counter And check out The book Interlibrary Check out The book Search Library for The book N Do search on Topics Y Read news paper or books Sit somewhere And read
Use Case diagram • use case is a pattern of behavior the system exhibits – Each use case is a sequence of related transactions performed by an actor and the system in a dialogue
Use Case diagram Circulation Clerk Member Borrow Books uses Check Library card Return books uses Do research Read books Newspaper Purchase supplies Supplier
Identifying actors • Represent a role a user plays • Think of roles rather than people Sylvia Member Borrow Booka Jackie Employees Order Book Lili Volunteer Check IDs USER Can play the role of Actor Performs USE CASE
Identifying Actor • Who is using the system? Or who is affected by the system? • Which group needs help from the system to perform a task? • Who effects the system? • What problem this application solve? (for whom) • Which external hardware do the system use to perform a task?
Identifying use cases • Way actor interact with system • For each actor find the tasks and function they are going to perform
Case Study : Analysing Citi. Bank ATM • The Bank Client must be able to deposit an amount to and withdraw an amount from his or her accounts using touch screen ATM kiosk. Each transaction must be recorded, and the client must be able to review all……………. .
Identifying Actors • Bank Client (Actor) • Bank ATM transaction (Use case) – Steps in use case • • Insert ATM card Perform the approval Ask type of transaction Enter type of transaction Perform transaction Eject card Request take card Take card.
Activity diagram Arrives at ATM Insert the card Enter Password not accepted Password accepted Select type of transaction More transactions Perform the transaction Take the card No more Tx
Use case name • • • Approval Process Invalid PIN Deposit Amount Deposit Saving Deposit Checking Withdraw Amount Withdraw Checking Withdraw savings denied Checking transaction history Saving transaction history
The Checking Account use case Bank ATM Tx Deposit Amount extends Bank Client Withdraw Amount Deposit Saving Withdraw more from Saving Withdraw saving
Approaches to Identifying Classes • Noun Phrase Approach – Look for noun phrases they are classes and adjective to be methods – All plural Changed to singular – Nouns are listed and divided into three • Relevent classes • Fuzzy classes • Irrelevent classes
Identify tentative classes • Look for noun and noun phrases • Some classes are implicit and are taken from general knowledge • All classes must make sense • Carefully choose and define class name.
The Citi. Bank ATM Project • Initial list of noun phrases – – – – – – Accounts balance Amount Approval Process ATM Card ATM Machine Bank Client Saving account Clients Accounts Currency Dollar Envelop Four digit fund Invalid PIN system Message Money Password Step transaction Transaction history
The Citi. Bank ATM Project Initial list of noun phrases Accounts balance Amount Approval Process ATM Card ATM Machine Bank Client Saving account Clients Accounts Currency Dollar Envelop Four digit fund Invalid PIN system Message Money Password Step transaction Transaction history
The Citi. Bank ATM Project • It is safe to remove irrelevent classes • Envelop, step, four and Digits • Strikeout indicates removed classes
The Citi. Bank ATM Project • Initial list of noun phrases – – – – – – Amount balance Amount Approval Process ATM Card ATM Machine Bank Client Saving account Clients Accounts Currency Dollar Envelop Four digit fund Invalid PIN system Message Money Password Step transaction Transaction history
The Citi. Bank ATM Project • Review redundant classes and building a common vopcab. . • Select the most meaningfull amongthe words describing same idea • Client, bank Client == Bank Client • Account, Clients Account = Account • PIN, PIN Code == PIN • Checking, Checking ammount=checking Amount
Building common Vocab. • Initial list of noun phrases – – – – – Accounts balance Amount Approval Process ATM Card ATM Machine Bank Client Saving account Currency Dollar fund Invalid PIN system Message Money Password Step transaction Transaction history
Reviewing the possible attributes • Noun Phrases only with attribute • Amount : A value not class • Account balance : An attribute of Account class • Invalid Pin : Only a value • Password : An attribute • Tx History , PIN : Attributes
Revised List • • • • Accounts Approval Process ATM card Bank Clients Cash Check Currency Dollar Fund Message Record Saving Accounts System Transaction
A sequence diagram for Invalid PIN Use case Client ATM Machine Bank Client Insert ATM card Request for PIN Enetr PIN Verify PIN Bad PIN Eject ATM card Bad PIN
Collaboration diagram for withdraw checking use case 2. Enter Kind 4. Enter Amount 13. Terminate 5 Process Transaction Accounts ATM Teller Machine Bank Client 8. Transaction Succed 7. Withdrawal Success 1. Request Kind 3. Request amount 4. 9. Dispensed cash 10. Request take cash 11. Take cash 12. Print receipt 6. Withdrawal checking amount Checking Accounts
Associativity Bank Client Account 1 1, 2 Has
Example • A University wants to computerize their registration system – The Registrar sets up the curriculum for a semester • One course may have multiple course offerings – Students select 4 primary courses and 2 alternate courses – Once a student registers for a semester, the billing system is notified so the student may be billed for the semester – Students may use the system to add/drop courses for a period of time after registration – Professors use the system to receive their course offering rosters – Users of the registration system are assigned passwords which are used at logon validation 29
Actors • An actor is someone or some thing that must interact with the system under development Registrar Professor Student Billing System 30
Use Cases • use case is a pattern of behavior the system exhibits – Each use case is a sequence of related transactions performed by an actor and the system in a dialogue • Actors are examined to determine their needs » Registrar -- maintain the curriculum » Professor -- request roster » Student -- maintain schedule – Billing System -- receive billing information from registration Maintain Curriculum Request Course Roster Maintain Schedule 31
Use Case Diagram Request Course Roster Professor Student Maintain Schedule Billing System Maintain Curriculum 32
End of Session 3
- Slides: 33