Best Practices for Default Field Values
Posted: Wed 20 Apr 2011 16:06
What are the best practices for creating default values for fields in a table?
(Basically, handling the existence of default values set in the database, or overriding such behavior at runtime.)
There are two kinds of default values I mean:
1. The value to provide without any user interaction (default creation timestamps and the like)
2. A default value to put in a NEWed up object, but which can be overridden by the user before saving.
I'm eager to learn if there is a tried-and-true approach I'm not seeing.
(Basically, handling the existence of default values set in the database, or overriding such behavior at runtime.)
There are two kinds of default values I mean:
1. The value to provide without any user interaction (default creation timestamps and the like)
2. A default value to put in a NEWed up object, but which can be overridden by the user before saving.
I'm eager to learn if there is a tried-and-true approach I'm not seeing.