Collection of enum constants as custom attribute type
Collection of enum constants as custom attribute type
- Subject: Collection of enum constants as custom attribute type
- From: Paul Hoadley <email@hidden>
- Date: Mon, 08 Jul 2013 16:30:26 +0930
Hello,
I think in the course of trying to work out how feasible this, I've actually changed my mind about even doing it. But just for completeness, has anyone ever used a collection (ideally an EnumSet, but realistically even an NSArray would do) of enum constants as a custom attribute type in a model? Using the stringArray prototype, I've managed to get the array saved out into a text column, but not surprisingly it just reads back in an array of strings. My naive attempt to genericise the array via "Value Class" in the model failed, as did using the blobArray prototype (wrote out, failed to read back in). I'm fairly sure I could press on with strings and write some cover methods to give me an NSArray<SomeEnum> (or even EnumSet<SomeEnum>), but I lost interest in the idea, and now I'm merely curious. Let me know if you've tried it.
(The reason for the loss of interest is that obviously I'm subconsciously trying to model a to-many relationship here without wanting to admit it. The destination objects (whether they be EOs or enum constants) won't change very often (possibly ever), and I had convinced myself that enums would somehow be "lighter weight". Of course, as soon as someone decides to _delete_ a constant, you've got a data integrity issue. Seems like a false economy.)
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden