Open Source "UML Almighty": Executable UML, Simulation, Prototyping and more

June 17, 2010

UML Simulation Example with ATM Model – Prototype and Executable UML

Filed under: Executable UML, OOP, UML, UML Simulation — umlalmighty @ 6:42 pm

In this example will see how to create a Simulation with UML Almighty using an ATM Model. (Check the Videos)

After installing the XMI file it take  10 minutes to finish the UML Almighty simulation (including the Prototype, the Executable UML and the UML Simulation itself).

The ATM Model is just a possible solution for this problem. The Simulation shows how different UML Diagrams fits with UML Almighty.

We will see two Use Cases in detail: ATM login and Perform a Deposit.

Use CaseATM Login

The User/Customer stars a new Session where the user name and password are entered.

If the entry data match the Card the Panel of Transactions is displayed.

Use Case: New Deposit

Here the Customer start a new Session (insert a card and type user name and password) in the ATM machine and then Deposit an amount of money to his Account.

UML Class Diagram – UML Model

Description

ATM class represent the real ATM machines. Each User (actor) start a Session in an ATM machine. This relation is an association class ATMLogin.

The ATMLogin has the user name and password. After enter the user name a Session is created. With a Session the User can perform different Transactions.

Each Card belongs to an Account of a Bank. The Bank perform the different Transactions. To simulate the Card insertion a list of Cards is displayed to select one.

The ATM machine has Log of operations. The ATM bills are manage by the InnerCash handler.

-

Activity Diagram

Description

The process starts when the User enter the user name and password. Then select a Card (to simulate Card insertion).

After login succed the User has the Panel of Transactions to perform different tasks.

In this panel the User can perform: a Deposit, a Transfer, a Query or a Withdrawal.

If confirmed the Transaction is performed and then Panel of Transactions is displayed again.

The User can perform another Transaction or logout. The transaction process will be shown in detail with Sequence Diagrams.

The following pictures shows the GUI: User and  Password which is the GUI for the instances of UML association class [ATMLogin].

This is the Web Page generated by UML Almighty for ATMLogin class, we named “GUI: User and Password” to the GUI of ATMLogin class.

From the GUI of ATMLogin the User can login into the ATM account.

Login Simulation Video

This is the Sequence Diagram for the Login process (check the video)

As we can see in the Sequence Diagram the login process returns (or starts) a new Session. From this Session the User can perform different operations.

Check the GUI: Panel of Transaction (picture above) to see the GUI for the instances of Session class.

The following is the Simulation Code for the UML Method [loginWith:] of Class ATMLogin

Method’s comments in green color.

As we can see in the Sequence Diagram the login process returns (or starts) a new Session.

When the user clicks Login button in the UML Almighty prompt a list of Cards (to simulate Card insertion).

When aCard is selected then [loginWith:] method is executed. This UML method belongs to ATMLogin class (check Sequence Diagram).

<aCard> argument is the Card selected by the User.

The method compares the password and user names of Card and ATMLogin (data entry in the web). If succed returns aSession (check simulation code).

This Session is displayed in other WebPage where the User can perform: Deposits, Transfers, and so on.

The following pictures shows the GUI: Panel of Transactions which is the GUI for the instances of UML class [Session].

New Deposit

The following picture shows the GUI for a Deposit. We named deposit GUI as GUI: Deposit Panel.

After data entry the User has to Confirm or Cancel the Deposit.

When the User click Save Object then the following page is displayed:

The following Sequence Diagram shows the Deposit process in the ATM system.

1. The User click NewDeposit in Panel of Transactions (SessionGUI)

2. A new Deposit is created and it is displayed in a Deposit Panel (DepositGUI). The User entry data (Deposit Panel 1).

3. The User Confirm or Cancel the Deposit (Deposit Panel 2)

4. The Bank perform the Transaction with Account (processDeposit:for: method).

5. The Panel of Transaction is displayed again with the result of last transaction. Now the User can perform other Transactions.

Simulation Code for the UML method #confirm in the Class Deposit

Simulation Code for the UML method #processDeposit:for: in the Class Bank

The following picture shows the Transaction result:

Simulation Video of a Deposit


About these ads

5 Comments »

  1. very good its very help fullllllllllllllllllllllllll

    Comment by hanish — December 15, 2011 @ 6:19 pm

    • Thanks very much !

      If someone want an example in other domain just ask for it.

      Regards,
      Bruno

      Comment by umlalmighty — December 22, 2011 @ 11:02 am

  2. Thanks, its a very good illustration. The diagrams are on point and they are very helpful. Much thanks – Sneidon

    Comment by Sneidon — January 17, 2013 @ 10:41 am

  3. Hi,

    You are welcome !

    Regards,
    Bruno

    Comment by umlalmighty — May 10, 2013 @ 7:33 pm

  4. this site helps me a lot with my study thank you for making this as a help to us student..

    Comment by marcus.john49@yahoo.com — October 7, 2013 @ 10:10 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: