3.4 Representing concepts

The accounts of John Smith, Liza Jones and Mary Pole are examples of phenomena from the application domain that we would like to represent in our bank system as objects.

Class Account on the other hand represents the concept of a general account from the application domain. The concept account is a generalized idea covering all possible accounts such as the ones of John Smith, Liza Jones and Mary Pole.

For people, concepts are essential for organising and understanding phenomena in the world. We cannot relate to each individual phenomenon. Biology classifies phenomena as concepts; the concept dog covers all possible dogs. The concept vehicle covers all possible vehicles; the concept book covers all possible books; etc.

A concept is often defined as follows:

A concept is a generalized idea of a collection of phenomena, based on knowledge of common properties of elements in the collection.

A concept is traditionally characterized by the following terms:

  • The extension of a concept is the collection of phenomena that the concept covers.
  • The intension of a concept is the collection of properties that characterize the phenomena in the extension of the concept.
  • The designation of a concept is the collection of names (or pictures) by which the concept is known.

As mentioned, a class may represent a concept: the intension of the concept is represented by the attributes (data-items, methods, etc) of the class; the extension is the set of objects generated from the class; and the designation of the concept is represented by the name of the class.

Representation of Concepts and Phenomena

A type representing values like integer, real, and date is also an example of a concept. The intension of a type is the properties of the of the given type. The extension is the phenomena that may be characterised by the type. We discuss types representing values further in section X.

In the paper Notes on data structuring, C.A.R Hoare has an excellent description of how abstract concepts like numbers may be understod and the importance of abstraction. As an example he uses the number 4 which characterize all collections of four phenomena (called objects by Hoare) like four apples. He does not use the terms intension and extension. Instead of intension he use axioms to characterise numbers.

A third kind of concept covers activities. Examples are cooking, travelling, programming and soccer playing. The intension of the concept cooking includes the properties that characterise cooking. The extension is all cooking activities. The examples here are very general and difficult to make precise descriptions of. This is in contrast to value types like numbers which may be formally described by axioms.

The activity of cooking a tomato sauce may be described as follows as a sequence of actions:

  1. Peel and cut 4 cloves of garlic.
  2. Add olive oil to a hot sauce pan.
  3. Add the piled garlic and cook under medium fire and void them to be brown.
  4. Add a can of peeled tomatoes.
  5. Add basil, salt and peber to taste.
  6. Cook for 10 minutes.

For the bank system we may have an activity for transfer of 500 EUR from John Smiths account to Liza Browns account, assuming that John Smiths account has at least 500 EUR.

  1. Make a withdraw of 500 EUR from John Smiths account
  2. Make a deposit of 500 EUR on Liza Jones account.
  3. Inform John Smith and Liza Jones that the transfer has been done.

In section , we show how to represent a transfer activity in a program.