Moving bits

I'm solving the same problem again. I have an object written in C# that I need to store in a database.

Even though I've expressed the object in C#, I need to also express the same object in XSD and in SQL. I've run "xsd.exe" to generate a memento class that contains the data but no business logic. I've written code to move the data from the business object into the memento class, serialize it to XML, and send it to the server. On the server, I've written code to receive the XML, deserialize it back to a memento, and turn it into a stored procedure call. I've written the stored procedure to update the row, unless it does not exist in which case it inserts.

I've done all this before. Every time the domain model changes, I do it all over again. Every year some new technology comes out that replaces part of the old stack, and I start writing the same code for that.

This stops now.

Leave a Reply

You must be logged in to post a comment.