Modeling Loops and Constraints Using Executable UML
Introduction: What is a loop?
A loop is a path of one or more contiguous relationships that originates in one class and leads back to the same class. Here is an example of loop involving three associations (R3+R2+R1):
And here is a simple loop involving only one association (R4):
When you begin modeling loops it is easy to make two kinds of modeling mistakes: redundant loops and imprecise loops. These mistakes may result in missed requirements, easily corruptible data, excessively complicated models and elusive bugs in your software.