Загрузка страницы

UML Class diagram example: Bank ATM system

In this video, we’ll show you how to create a class diagram for a bank ATM system.

Open up the Gleek app https://app.gleek.io in your browser. Select the “class diagram” option from the dropdown.

First, we need to work out what classes we need. We’ll start with the Bank class. Just type the word “Bank”, hit enter and the tab key, then add your attributes and methods.

The bank needs a code to identify it and an address. The methods that the bank class can use to interact with its ATM are manage and maintain.
The plus symbols indicate that these attributes and methods are public.

Next, we need to create our ATM class. The ATM is managed by the bank and it has a location. Its methods are related to transactions, which it identifies and carries out.

We should add a line between the bank and ATM classes to show how they work together.

Just type the word Bank followed by one in curly brackets and the label “maintains” and the ATM. The one tells us that a bank can have one ATM.

Every bank needs customers, so we’ll create a Customer class. Customers need a name and an address. The relationship between the bank and the customer is that the bank has customers.

The only method for the customer is to own an account and to own a debit card. Let’s create those now. An account has a type, such as savings or checking. It also has a method to enable it to check the account balance. A customer owns the account, so we create a labeled connection between the two.

The DebitCard class has a card number and is also owned by a customer. Its method enables it to access the ATM and therefore the account. We’ll connect the customer with the DebitCard class.

Now we need to model the transactions that can take place when the customer uses the ATM.

The base class for this is ATMTransaction. It has three attributes: transaction ID, date, and type. Its method is to update.

Let’s imagine that the customer can perform two different types of transactions on the ATM.

They can withdraw funds or transfer funds to another account.
For the first, we need an ATMwithdraw class. That has an amount attribute and a withdrawal method.

The second is covered by an ATMtransfer class. This also has an amount attribute, but it also has an account number attribute so that the customer can send money to a
different account.

These last two classes are special, because they share the ATMTransaction class as their parent class. That means that they can inherit functionality from the parent class. For instance, these transactions can make use of the update method to interact with the account
class. You can show inheritance in a class diagram by using solid arrows.

Now we just have to create the last two interactions. The ATM identifies an active ATM transaction and the transaction can in turn modify the customer account.

So that’s a basic class diagram of an ATM system. It shows you how easy it is to sketch out how systems work in Gleek.

If you learned something new, hit the like button, or subscribe for more videos.

Happy diagramming!

Видео UML Class diagram example: Bank ATM system канала Gleek diagram maker
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
9 ноября 2021 г. 23:53:01
00:05:12
Яндекс.Метрика