How do I analyse and document an existing business
process using the Unified Modeling Language (UML)? - Part 3
Class Diagram
Systems are assembled from objects, which may be physical such as computers, people and raw
materials, or abstract such as information or knowledge. Objects are described
by their internal properties and their relationships to other objects. For
example, Andrea's bank account (an object) has attributes common to all bank accounts, such as balance, account
number and name of account holder. Additionally, Andrea's bank account has
relationships to other objects, in this case to a specific bank branch (a bank
object) and to Andrea herself (a person object).
Attributes are described with a name and a type (integer,
Boolean, string, date, etc.). For instance the account number integer is an
integer (a type). In UML it is shown as:
Account
Number : Integer
Objects also have behaviour;
for example, Andrea could ask her bank for the balance of her account.
Behaviour is described with operations
attached to the objects. A bank account could have 'cash withdrawal' and 'get
balance' operations.
A class is a set
of objects with the same characteristics. Typical business classes are Person,
Invoice, Company, Supplier, Order, Product and Goal. Classifying and grouping
objects into classes reduces the complexity and number of elements when
modelling, and facilitates describing more complicated systems.
Classes are modelled and related to each other in a class diagram. Each class is described
with a name, attributes and operations. The relationships (or associations) between the classes are
described with a name, roles and multiplicity. For example, many companies
(employers) can employ many persons (employees). This relationship can be
described in terms of classes:
If we are to consider attributes and operations, these are
illustrated as follows:
Attributes with a plus sign (+) in front of them are public
meaning that other classes can access them. Attributes preceded by the minus
sign (-) are private, indicating that only the class itself and its objects can
access the attribute.
Review Questions
Test your understanding of this topic with the following
questions.
What is the
relationship between an object and a class? |
|
|
You will need to do
a little research for this question. What do the terms 'generalisation' and
'aggregation' refer to? How are they used in
class diagrams? |
|
How are class
diagrams used in business modelling? |
|