The implementation used where I work uses about 10 columns in the table: CUSTOMFIELD1, CUSTOMFIELD2 etc. And every time I look at it, I think there must be a better way.
Not everyone will use all 10, some will use 0 and so there these empty columns just staring back at me, begging to be used.
So if there is a better way... ideally, I think it'd allow:
- More than 10 custom fields. Theoretically, infinite. Practically, something sane like 15.
- Each custom field could be given a name, set by the user.
- The custom fields type could be set. Basic types like: string and number.
So far, I'm thinking of having a column named CUSTOM_FIELDS, which will store a path to a file containing the custom fields' descriptions, names, types etc. in a format like XML, JSON or YAML which I could transform back into an object. And that's just the custom field's definiton, there's the whole matter of how I save content that uses these custom fields...
Anyways, that just where my thoughts are now. Any ideas?
PS --- I'm of the mind that customising the application to suit the user would be more ideal than slapping things into custom fields, but I don't have that luxury & other times defining an extra 2 custom fields just works.