I know that there are a few (automatic) ways to create a data access layer to manipulate an existing database (LINQ to SQL, Hibernate, etc…). But I'm getting kind of tired (and I believe that there should be a better way of doing things) of stuff like:
- Creating/altering tables in Visio
- Using Visio's "Update Database" to create/alter the database
- Importing the tables into a "LINQ to SQL classes" object
- Changing the code accordingly
What about a way to generate the database schema from the objects/entities definition? I can't seem to find good references for tools like this (and I would expect some kind of built-in support in at least some frameworks).
It would be perfect if I could just:
- Change the object definition
- Change the code that manipulates the object
- Compile (the database changes are done auto-magically)
Check out DataObjects.Net - is is designed to support exactly this case. Code only, and nothing else. Its schema upgrade layer is probably the most featured one you can find, and it really fully abstracts schema upgrade SQL.
Check out product video - you'll notice nothing additional is made to sync the schema. Schema upgrade sample shows the intended usage of this feature.