Exam4Training

In your model, you need to represent accounts.

In your model, you need to represent accounts.

Which statement supports using a Class, rather than a DataType. lor this purpose”
A . The account is uniquely identified by its account number.
B . The account number can change, but it would still be the same account.
C . The account needs operations to transfer money into it or to withdraw money
D . The account has attributes typed by Classes like account_holder; Person or bank_in_Charge Company

Answer: C

Explanation:

In UML, a Class is a template that defines the structure and behavior of objects, whereas a DataType is a type of classifier which specifies a domain of values without identity. Operations (such as money transfers and withdrawals) are behaviors that change the state of an object and, therefore, are defined in Classes rather than DataTypes. This suggests that accounts, which require operations to transfer and withdraw money, should be modeled as Classes.

Reference: UML 2.x Superstructure Specification: Provides definitions for Classes and DataTypes, and details the circumstances under which each should be used. It specifically states that Classes can have operations while DataTypes cannot.

UML 2.x Infrastructure Specification: This foundational document provides an in-depth explanation of UML modeling constructs, supporting the use of Classes when operations are needed to manage an object’s state.

Exit mobile version