I have a design question.
We need to put some default, system defined content into the site but at the same time users can add to it. So my question is where is the best place to store the default content? Should we follow the principle that if its unchangeable then its configuration and should be with the code, or should we keep everything together in DB?
An example:
Validation rules based on regexp.
Say we want user to be able to select what validator he wants to use for his field + he can create his own validators. However, some of the validators will be ‘untouchable’ by the user. For example Zip code regexp, email regexp – those will be available for every user out of the box and they should not be able to modify those.
So what would be the best practice? Keep ‘untouchables’ in the code and merge with DB return of custom content or just keep everything in DB?
Any configurable Item can go to a property file, as it does not need compilation on modification, but it is purely internal
If you are exposing the configuration to the User, the DB would be the right option
Have a screen for every configuration and update the table value. In future, if you want to remove the access, you just need to hide the screen but still the functionality is available in the back end