2.10 On representing phenomena

image_pdfimage_print

When we create a model of the bank system, we represent relevant phenomena of the bank system as objects. The accounts of John Smith et al. are examples of relevant phenomena that we represent in our object model. In the previous sections, we have shown how to represent an account as an object. The accounts are examples of physical phenomena – physical in the sense that they consist of matter and exist in time and space.

A physical phenomenon has an identity. Physical phenomena are distinct which means that they have different identities.

A physical phenomenon is also characterized by existing in time and space. It may exist for a short or long period of time, and it is located in a specific position in space at a given time – a position that may change over time.

A paper-based bank account has an identity of its own, a vehicle has an identity, a person has an identity, etc. Two different paper-based accounts have different identities, even if all properties of the two accounts are the same. The same for two vehicles, two persons, etc.

In the same way, we also consider an object to have an identity – an object exists in the computer just as a physical phenomenon exists in the real world. An object representing an account thus has an identity and two different Account objects have different identities even if their data-items hold the same datums.

The analogy to space and time of physical phenomena for objects is that objects also exist for a period of time during a program execution, and it is placed in a specific memory area of the computer.

In addition to the accounts, properties of the accounts are a second kind of phenomena that we want to represent in the model. These properties include the owner, account number, and balance of an account. In the model these phenomena are represented as data-items in the object representing the account.

A third kind of phenomena are activities in the bank system. These activities include the quarterly calculation of interest rate and deposit and withdrawal of money from the accounts. In the object model, we may represent activities as computations generated by methods.

In general, an activity is a partial ordered sequence of actions where an action is a thing that happens, that makes changes and/or make observations of properties of physical phenomena or creating or destroying physical phenomena.

Activities are carried out by physical phenomena, which may be machines, people, or other physical phenomena. A given activity may be carried out by a single physical phenomenon or by a group of physical phenomena.

An activity may be sequential in the sense that the actions are totally ordered, and the term sequential activity is used for this. Activities may also take place at the same time, carried out by different entities – the term parallel activities is used here. The definition of activity is analogous to the term computation defined in section , i.e. the actions in an activity in general are also partially ordered.

In general, a phenomenon is defined in the following way:

A phenomenon is a thing that has definite, individual existence in reality or in the mind; anything real in itself.

An important part of designing an object model of a given system is thus to identify relevant phenomena of the system to be represented in the model. Whether or not a phenomenon is relevant depends on the purpose of the model. For a given system one may design different kinds of models that may be used for different purposes. It is not possible to define a complete model of a system. We return to this later in this book.

In the above example, we have identified three kinds of phenomena:

  1. Physical entities like accounts and customers.
  2. Properties of physical entities, like owner, balance, and interest rate.
  3. Activities like calculation of interest rate and deposit and withdrawal of money from accounts.