i'm designing model in groovy. so, have static amount of values need map on model.
so example:
class model () { staticvalues values } initially, thinking of implementing unto enum.
enum staticvalues { value!, value2, ... } the problem is, become big, might contain hundreds of elements. since subclassing enums not possible, there alternative approaches problem?
the staticvalues plain hardcoded constants. these values represented plain string.
however, these values going used keys querying model. important contain valid values. why intend make values field "typed" rather string.
you can implement interface enum , can have multiple enum implement interface or sub class.
btw few hundred enum shouldn't problem.
Comments
Post a Comment