What do you do for miscellaneous data buckets?

What do you do when an application has to store extra data that varies? For example, some customer data requires number of cats, others require number of felonies. This is not data I need to search, and I can obviously sort it pretty easily in business objects.

How do you store it? I thought that the ASP.NET v2 scheme for profile data was kind of clever. I also suppose you could dump some simple XML into a text field in the database.

What would you do?

3 Comments

  • Hi Jeff... I use the same technique. Effectively a table of name/value pairs which I call "Attributes". That way you can just select all of the Attributes for a given entity easily and it keeps your schema simple and clean.

  • 1. Easy answer: ye olde HashTable.



    2. Move it to another object that provides and caches the information as-needed rather than mussing about with the core object.



    3. Dropping XML into a database field--ugh! Why not design the database correctly in the first place? A simple FKUserID/name/value table would do nicely and give you searchability when you eventually need it.

  • The object representation is not something I was even remotely interested in getting your opinion on. I was speaking strictly of persisting the data.

Comments have been disabled for this content.