4GL Patterns #13 – Read Only Fields

Note, this is Part 14 in a series of posts documenting patterns used in RAD development of Line of Business applications. You can find more here 4GL Patterns

Some data dictionary mark certain fields as being read-only. Why should fields ever be read-only? How do they get edited in the first place?

Possible justifications:

  • The field represents a permanent record, i.e. it behaves more like a document than a database field. A field can be set at record creation time and no-other.
  • The field represents an integration field. For instance, an account_details table may have it’s e-mail and telephone fields populated from an LDAP source. By marking up the metadata consistently, the user interface automatically renders a field as label, or as a locked text box.

Validation checks should not apply to read-only fields. A clever code generator should warn the developer that validation rules have been applied on read-only fields, and these rules should be turned off.


About this entry