What is a class?

< Class

Introduction
A class is a concept that groups objects with similar characteristics So you can create a class dogs and cats or a class animals.



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.

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.