views:

27

answers:

0

I maintain a fairly complex infrastructure consisting of a number of setups like the following:

  1. 3rd party application server with its built-in database
  2. 3rd party unmanaged c++ API library which exposes methods to query and/or receive updates from the server; also contains data structure definitions

  3. My managed wrapper for the library; exposes lib functionality to in-house .NET applications that need to communicate with the server.

  4. My c# class library containing byte-for-byte equivalent data structure definitions from point 1.

  5. My bridge application which synchronizes server data in real time with my database (sql server)

  6. My data access layer library

  7. Database

The part from 1 to 5 is sorted out in a satisfying way as I use generic UnmanagedToManaged (and vice versa) methods for marshaling data from wrapper to API lib; the only thing I need to keep updated is my library from point 4. against definitions from point 2.

Since the structures are of fixed size (the only thing changing is reduction of reserved fields size and introduction of fields of equivalent size) I don't have marshaling issues, nor version issues when my code doesn't match the latest 3rd party update.

The problem begins at point 5. I have to manually define the tables in the database, field by field, then autogenerate the stored procedures and use either a framework like dOOdads for access, or do it manually.

This is all done using VS 2005 and .NET 2.0.

Currently I am evaluating VS 2010 Beta & .NET 4 for use in future projects and as an important exercise would like to reimplement this setup using LINQ.

Ideally, I would like to manually deal with data structures only at two points:

a. Class library from point 4.

b. Mapping file (or whatever) where I would tweak the sql tables, data types, constraints and relations autogenerated from c# data structures.

My question is - can I realistically expect something like this? Would there be a significant decrease in need to write boilerplate code or am I better off continuing the way I do things now?