Add code generation for enumerations to Umple's other supported languages #1041

Open
jblang94 opened this Issue Apr 7, 2017 · 0 comments

Comments

Projects
None yet
3 participants
@jblang94
Contributor

jblang94 commented Apr 7, 2017

Brief Description

In #1008 Umple's Java code generation was updated to support user-defined enumerations. Enumeration code generation needs to be implemented in Umple's other supported languages such as PHP.

Code generation needs to handle the cases in which the enumerations are defined inside and/or outside of classes.

// Enumeration within a class

class Student {
  enum Status { FullTime, PartTime }
  Status status;
}
// In this example, the "Status" enumeration is shared by the "GradStudent" and "UndergradStudent" class
// The "Semester" enumeration is only defined for the "UndergradStudent" class

enum Status { FullTime, PartTime }

class GradStudent {
  Status status;
}

class UndergradStudent {
  enum Semester { Spring, Summer, Fall, Winter }
  Status status;
  Semester semester;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment