A more functional serialization wtih rdbms's?

  • Thread starter Thread starter Ruffin Bailey
  • Start date Start date
R

Ruffin Bailey

It appears your only route for using System.Runtime.Serialization and
friends with a database is to use a blob field and shove the zeroes
and ones in there. This loses half of the reason you're shoving
everything into a database to begin with -- sure you can pull out your
serialized object, but you're not able to search by properties or
group by expressions, etc.

Short of rolling your own objects, is there any "more intelligent"
method to get serialization, more along the lines of what I get in
Java using JDO (http://java.sun.com/products/jdbc/related.html#what_is)?

I realize there's a bit of a mixed metaphor going on here (relation
databases versus object oriented programming), but I'm not sure there
has to be.

Thanks,

Ruffin Bailey
 
I seem to be hitting a very similar wall in trying to
serialize control properties (you'll probably see a few of
my postings)...

If you want to dig deeper, I would suggest looking at:

http://msdn.microsoft.com/msdnmag/issues/02/04/net

for the first of 3 articles on serialization.

After some searching I found:
http://www.sellsbrothers.com/tools/SafeFormatter.zip

a very useful start if you find you want to start coding
your own serialization formatter, which might get you what
you want in terms of a more flexible, easily searched
file - a similar requirement to the type of serialization
file I am working on:

(Sorry if this is more ranting than helping)

I am struggling with a configurable HMI (human machine
interface) for a machine control. In my case, it would be
nice to get a text file which describes the layout of the
form. Then it would be even better to have multiple files,
like templates, which could change the layout in a
cascading manner. So instead of a different
source/executable for each control permutation I want a
single source/executable and a few templates with which I
would customize the layout for different machines and
again for different cultures. The templates would be
independent, only describing changes to the control to
convert it into the desired form.

Unfortunately, none of the built-in controls are marked
Serializable so that was hurdle 1, just getting started in
serialization meant you need to write your own interface
at your base classes (fortunately, in my case, so far,
there are only 2 I derive from), then start looking into
type surrogates to access the control's members... I
decided not to get into surrogates, looked like it could
end up a can of worms - plus the result would still be
Soap/XML and a lot more learning (for me) to make sense of
it and code to figure out how to generate/process
templates (why is simple text so horrible? I mean an old
fashioned WIN.INI file or a comma-separated text file with
a few standard terms would probably be plenty sufficient
for serialization).

For me, I decided to do a more limited serialization and
wrote a custom formatter to generate a more useful (to me)
file format which is where I'm currently struggling as I
delve deeper into serialization.

Good luck!
Markus
 
Back
Top