Both of your points are valid and follow a traditional normailization approach to DB design.
I was hoping to be able to "coin" a way to allow users to define their own "XCodes" without getting a developer involved in creating the table, the new relationship, the middle tier code gen, and the UI to display and collect the new "XCode".
For example, I already have a way to allow users to define their own custom fields and the data types. I have also created a way to allow users to define their own pick lists / combo boxes. For example, the user can currently create custom field definitions, associate these definitions to OrganizationEntities, and PeopleEntities. Once the fields have been defined the UI can collect the data and save the data to the database in the appropriate column for the appropriate Organization or Person Entity.
The kicker is that from a business stand point, we make no business decisions or aggregation of the Organizations and People based on the physical values collected in the custom fields.
One approach that I was considering was to allow the users to define a composite key, then create a table based on the properties of a composite key. For example, client A might define a mask for their key as AAA-999 and client B might define their key as AA99-99999. At the time that this key was created, client A's XCode table would look like this:
KeyId int identity(1,1),
PersonId int (FK to person)
KeyField1 char(3),
KeyField2 char(3)
and client B's XCode table would look like so:
KeyId int identity(1,1),
PersonId int (FK to person)
KeyField1 char(2),
KeyField2 char(2),
KeyField3 char(5)
Assuming the key definition was stored in the client config table we could always foward and reverse engineer the values taken from and displayed in the UI using the XCode entity and the key definition.
I was also thinking that I could create multiple XCode tables, i.e. XCode1, XCode2, etc. and allow clients to define multiple XCodes and assign the XCodes to People in any way they wish.
Does this sound like OTT functionality or what? Once again your thoughts are much appreciated.