I have a question about association multiplicity. I understand it, but for example if I would have:
--------- ---------
| |1 * |
No,the * means not that there's at least one Student in each Class at any time. But the other direction, looking from Student to Class, the multiplicity means that any student is in exactly one Class.
For modelling reasons you might want to change the 1 multiplicity also to *, but this depends on your context.
dose that mean that at ANY point during system existence there must be at least 1 student assigned to the class, or those multiplicities should be true, if the system is operating normally.
That's a good question. It means that, when the system is in a stable state, every Student MUST be associated with exactly one Class. That in turn raises another question: what constitutes a 'stable state'? UML in general doesn't formalise this. Intuitively, it means when there's no activity in progress that is actively changing state. Some profiles of UML put more rigour around this. For example, Executable UML says that the system can violate the cardinality constraints while the action of a state is executing. However when the state action completes it must leave the system in valid state, i.e. where all cardinality constraints are satisfied.
Databases provide a good analogy here. DB constraints (such as not null & foreign keys) must hold true when the system is stable. During the execution of a transaction the constraints may be temporarily violated. However, when the transaction completes, it must leave the db in a valid state.
So for your example as shown:
*
says 0 or more - so Class need not have any Students)hth.
dose that mean that at ANY point during system existence there must be at least 1 student assigned to the class
It means there is exactly one class assigned to multiple students.
Each end of the association has an upper multiplicity boundary and a lower multiplicity boundary, but most UML editors will only show one value if the upper and lower boundaries are the same. If you want to allow (zero or one) to many, you can write it like this:
0..1 *
-----------
What you really probably want here is a many-to-many relationship... students can be in many classes, and classes can contain many students.