Extensible objects with dynamic properties

  • Thread starter Thread starter noel.phillips
  • Start date Start date
N

noel.phillips

Hi,

I want to achieve a system that has a number of objects with what I
would call 'core' properties - that is properties defined at design
time which correspond (directly or otherwise) to a database schema. A
fairly traditional approach.

However, in addition I want the user to be able to define their own
properties, and to effectively 'extend' the object. As far as the
database goes this can be achieved with vertical tables or, say, SMO
etc.

My question is: is there a correct or accepted way to design the object
model to deal with this? Should the object have a hashtable which can
be indexed by the property name? How best can I deal with typing?
Should I infer from the database schema what the types of the
properties are?

Any thoughts or insight would be greatly appreciated - if any more
information or clarification is required please let me know.

Thanks in advance
N
 
Hi,

I want to achieve a system that has a number of objects with what I
would call 'core' properties - that is properties defined at design
time which correspond (directly or otherwise) to a database schema. A
fairly traditional approach.

However, in addition I want the user to be able to define their own
properties, and to effectively 'extend' the object. As far as the
database goes this can be achieved with vertical tables or, say, SMO
etc.

Could you give some clarification? Do you want the dynamic properties to
be created by the end user at run-time, or to be extended by a developer
who is using your classes?

Here is an article from CodeProject about implementing a property bag in c#.

http://www.codeproject.com/csharp/propertybag.asp

Andrew Faust
 
Andrew,

Thanks for your reply - I want the properties to be extended at run
time by the user. A fairly obvious example of this would be, I guess,
a CRM type schema that has core properties - but allows a user to add
their own information about a customer with custom fields.

I hope that makes sense

thanks
N
 
Back
Top