Title | Assignment 1 Sample Solution |
---|---|
Author | nasim best |
Course | Advanced Software Architectures |
Institution | Concordia University |
Pages | 6 |
File Size | 350.9 KB |
File Type | |
Total Downloads | 89 |
Total Views | 175 |
Nicolangelo Piccirilli...
Assignment)#1)
Due!date:!January!21st,!2019!at!23.55! Submission:!through!Moodle! Please!Note:!This!is!an!individual!assignment!and!no!late!assignments!will!be!accepted.!) ! Question!#1:! Given!is!the!following!simplified!description!of!an!automated!teller!machine!(ATM)!with!the!following! money!withdraw!use!case.! A! customer! uses! this! ATM! to! withdraw! cash! from! their! savings! or! checking! account.! The! user! is! required!to!insert!a!bank!card!in!the!card!reader!of!the!ATM!and!to!provide!a!PIN!number!to!gain! access!their!bank!account.!PIN!and!card!numbers!are!validated!through!an!external!bank!server.!Once! the! card! is! validated,! the! customer! can! select! from! the! touchscreen! menu! one! of! two! possible! accounts!(checking/savings)!from!which!the!money!can!be!withdrawn.! Next,!the!customer!enters!the!amount!to!be!withdrawn!on!the!ATM!keyboard,!and!the!ATM!will!verify! that!the!current!account!balance!is!sufficient!by!connecting!to!the!external!bank!server.!If!the!account! funds!are!sufficient,!a!transaction!will!be!created,!the!money!being!dispensed!to!the!user!through!the! money!dispenser,!the!bank!account!will!be!updated!and!a!receipt!for!the!transaction!will!be!printed! using!the!ATM’s!printer.!
Given!this!information:! a.)!!CreateadomainmodelfortheATM! b.)!!CreateausecasediagramfortheATM! c.)!!Create!a!fully!dressed!scenario!for!the!withdraw!use!case!(2nd!paragraph!of!the! description)! d.)!!Create!a!system!sequence!diagram!for!the!withdraw!use!case!described!above! e.)!!Createasequencediagramforthewithdrawusecase–indicateanyGRASPpatterns! ! Question!#2! What!are!GRASP!patterns!and!how!are!they!related!to!sequence!diagrams?!Justify!the!different! GRASP!patterns!you!used!in!question!#1! Some!Open!source!tools!for!drawing!the!UML!diagrams!–others!available!on! http://en.wikipedia.org/wiki/ArgoUML!WhiteStarUML! http://www.fujaba.de/resources/installation.html! You!can!also!hand!draw!it!and!then!scan!it!with!your!smartphone!,!but!using!one!of!the!above!tools! is!probably!easier.!
1.a!
!! 1.b!
!
1.c Number Name
1 Withdraw Money
Summary Priority
User withdraws money from his or her savings or checking account 5
Preconditions Postconditions Primary Actor Secondary Actor
Customer card and data has been verified by the System Customer has withdrawn money Customer ATM and Bank Server User has chosen to withdraw money Step Action 1 Customer chooses account type 2 ATM System asks for amount to withdraw 3 Customer enters amount System verifies account balance with Bank 4 Server 5 System creates transaction Transaction updates user's account through 6 Bank Server 7 ATM (money dispenser) dispenses money 8 Customer removes money 9 ATM (printer) prints receipt
Trigger Main Scenario
Extensions
10 11 Step
System shows closing message and dispenses customer's card User removes card Branching action
4a 4b 4c
System notifies costumer that the funds are insufficient System gives account balance System exits
9a 9b
System notifies customer that there is not paper available for printing the receipt System shows new balance
9c 9d
System shows closing message and dispenses customer’s card User removes card
1.d
Receipt
1.e High Cohesion
Controller Pattern
information expert
Creator Pattern
information expert
high cohesion
Creator Receipt
2. General Responsibility Assignment Software Patterns (GRASP) are principles or guidelines for assigning responsibility to objects in object-oriented design. Sequence diagrams show interactions between object and the order of this interactions. The relationship between sequence diagrams and these patterns is that people decide on responsibility assignment when drawing interaction diagrams, so these diagrams should reflect the application of the patterns and are a first step between the design and development of software. For the sequence diagram of the withdraw money use case I used the creator pattern between the ATM System and the Transaction class because ATM System has the initializing data that will be pass to the transaction when it is created. I also applied the controller pattern using ATM System class for handling input system events and trying to maintain modularity and high cohesion by creating individual instances of different elements (printer, dispenser, etc.) that have different responsibilities....