I am trying to work out the best database model for the current setup:
An administrator can create "customer products". This means services/products which customer can attach/subscribe to. The simple cases where the product simply costs a price, or the product subscription should send an e-mail is easy to model in the database.
But how about very specific backend code for a customer product? For example, one product might have very specific code implemented for checking a customer status on a different database. How can I map this relationship in the database so I can turn on/turn off some code based on the product settings.
My intuitive way of handling it would be to have a string column on the CustomerProducts table where a pre-defined set of strings could be set, e.g. "MyCustomCodeHandler", and then the code would check for the existence of this string in order to execute it. But for me it doesn't really feel like a real relationship between the database and code.
SQL Developer Table View not showing tables
ColdFusion 8 connect to remote access MDB
how to remove large objects in postgres
I would not recommend storing code in the database..
What is the production ready NonSQL database?
If you need to allow customers to create product types (in the object-oriented sense of "types") with associated code, I'd choose to deploy that code in the same way you deploy other code..
Is there a good reason I see VARCHAR(255) used so often (as opposed to another length)?
The custom code may also reference custom data stored in the database.
How do you modify a Domain Class in Grails?
I'd choose to create a dependent table per product subtype, and put the type-specific columns in there.
LINQ to Entities on (database != Microsoft SQL Server)
The relationship between this subtype table and the generic product table is one-to-one.
Good and small open source database for teaching [closed]
That is, the primary key in the subtype table is also a foreign key to the generic product table..