Draw on the right, write (Umple) model code on the left. Analyse models and generate code. This tool stores your data in cookies and on a server. I understand. Click to learn about privacy. Download Donate For help: User manual Ask questions Report issue
// Example showing nested states. class Course { code; description; 1 -- * CourseSection; } class CourseSection { // Example from Lethbridge and Laganiere: Object Oriented Software // Engineering: Practical Software Development using UML and Java // McGraw Hill, 2005 www.lloseng.com sectionId; Integer classSize = 0; Integer minimumClassSize = 10; Integer maximumClassSize = 100; // State machine controlling status status { Planned { openRegistration -> NotEnoughStudents; } Open { cancel -> Cancelled; NotEnoughStudents { closeRegistration -> Cancelled; register [getClassSize() > getMinimumClassSize()] -> EnoughStudents; } EnoughStudents { closeRegistration -> Closed; register [getClassSize() > getMaximumClassSize()] -> Closed; } } Cancelled {} Closed {} } boolean requestToRegister(Student aStudent) { register(); setClassSize(getClassSize()+1); } }//$?[End_of_model]$? class Course { position 49 22 149 80; } class CourseSection { position 50 151 214 114; } class Course { position 49 22 149 80; position.association Course__CourseSection 30,80 30,0; } class CourseSection { position 50 151 214 114; } class Course { position 50 30 109 45; } class CourseSection { position 50 151 214 114; } class Course { position 49 30 149 80; } class Course { position.association Course__CourseSection 31,80 30,0; }