In a passport there is a field: First Name, and that field has a value John.
I assert that it is correct to describe the relationship as follows:
Field First Name:
- Has a name (First Name).
- Has a set of valid values (e.g. defined by regex [A-Za-z. ]{1,30}
- Has a description (name that stands first in the person's full name)
And Passport is a set of pairs (field : field value), such that:
- passport has a field "First Name"
- passport has a value for field "First Name"
Point here is that it is incorrect to say:
"First Name value is John";
The correct way (conceptually/academically) is to say:
"passport has a value 'John' for field 'First Name'".
In practical terms it means (pseudo C#):
struct Passport {
Map<Field, object> fieldValues;
}
struct Field {
string Name;
string Description;
bool IsValidValue(object value);
}
Q: Does this make sense? Any thoughts?