in reply to Re: storing serialized object in a database
in thread storing serialized object in a database

If you don't use (overuse?) inheritance too much, adding a new table for each subclass isn't too bad. Essentially, what you could do is require that each object has a unique identifier, then use that as a key on which to join tables.

Assuming each class has a deserializing method (or something that lists which db tables contain its data), it's fairly easy to create a join statement to restore data. The serializer would have to take this into account as well, so you're probably better off with a simple method that returns a list of tables containing data to use.

The Everything Engine uses a similar technique, though it's made complicated by other things. Storing metadata in a relational database is a big win, though, and it's a fairly good solution from an implementation and performance standpoint.

  • Comment on Re: Re: storing serialized object in a database