Object-Oriented terminology

< UML/Alphabetical index

Introduction

 * What is a class?

University example
Here are some concepts you could distinguish at a university:
 * Course: Students can follow a course that is part of a study program.
 * Student: At a university you have a class called students. What distinguishes a student from other persons within or outside the university? On characteristic is that a student is registered for a study program. People that are not registered, will not belong to the class 'student'.
 * Study program: Another example is the concept of the study program. A university offers many study programs. The concept of study program refers to a collection of courses you can follow in order to obtain a degree. When we define the the class 'study program' want to understand the difference between a study program and a random collection of courses.



Modelling and validating a model

 * Level 0 in the university example are the objects so In the example below the objects or instances are of level 0.
 * The classes are level 1 (diagram or model level).
 * Modelling: Modelling is abstracting, it means that you make the transition from level 0 to level 1. You go from the instances to the definition of the concepts.
 * Validating a model: On the other hand when you want to validate the model you have to do the reverse. So you will take the model and reason on an example. You will start from level 1 and you will try to illustrate this level 1 by finding a level 0 example that proves or disproves that your model is right.

Two functions of classes
A 'Class' has two functions.

1. Intent of the class: On the one hand, the class will be the template or a model for a group of real world objects that are similar. It defines a type of instances and therefore we also call it an object type. This is called the "intent" of the class; it is the definition of the concept that defines class membership In our example a person is a student only if that person is subscribed for at least one study program at the KU Leuven. The template will capture characteristics that are relevant about the objects in the class In the case of students at the university, their name, their birthdate, their home address, their email address, ... are examples of features that are relevant for the concept of the student in the context of the university. The class definition will omit the irrelevant aspects. Irrelevant characteristics of students from the perspective of the university are: the color of their hair, the color of their eyes, their height, their weight ...

2. Extent of the class: At the same time, the class represents a collection of objects that conform to its intent. This is called the 'extent' of the class.

Tangible and intangible objects
Notice that classes can represent both tangible and intangible objects. Students are for example tangible objects while study programs are intangible objects. Both kinds of objects can be represented as classes in the UML class diagram.