In an experimental mood
I started today wanting to find a code generation suite. As I stated before, the most boring part of any project I do is the boiler plate code to allow me to communicate with my services. While I have templates that speed up the process, inevitably you move beyond the basic CRUD operations and need to get more advanced functionality in. Functionality which can't typically be solved by a template. My code to allow me to feed an HQL query with parameters works 99.9% of the time, but still has me writing out massive HQL queries which isn't fun.
So I stumbled around, and the first thing I found also turned out to be the most promising. But there were 2 problems, first it wasn't free and second and it didn't work. They have a trial download, for it (which is the CodeSmith generator by the way) which got me passed the free thing at least for 30 days. Got it running to find out that the SQLite provider they supplied doesn't work. At all. Since my database only exists in SQLite and their suite specializes in taking the schema from the DB and generating the boiler plate code based on that, it was thrown out the window.
So, I'm now looking at Entity Framework 4. I hear good things about how well it has evolved over the years and being purely Microsoft, I'm hoping it will either place nice out of the box, or there will be a community full of people to help me make it play nice. But it has a different problem. It can take the schema out of the DB, but cannot apply it back, at least not for SQLite.
My solution? I already have Fluent NHibernate mappings for my DB, I use a separate project which uses fluent to generate the DB and then I take the DB using Entity Framework and voila! I have a quick and dirty way to play around with Entity Framework with fully compiled code... yes it is redundant... I will have the same objects in 2 projects, the ones that Fluent used to create the Database and ones Entity Framework built based on the database... but I can't complain.
So I stumbled around, and the first thing I found also turned out to be the most promising. But there were 2 problems, first it wasn't free and second and it didn't work. They have a trial download, for it (which is the CodeSmith generator by the way) which got me passed the free thing at least for 30 days. Got it running to find out that the SQLite provider they supplied doesn't work. At all. Since my database only exists in SQLite and their suite specializes in taking the schema from the DB and generating the boiler plate code based on that, it was thrown out the window.
So, I'm now looking at Entity Framework 4. I hear good things about how well it has evolved over the years and being purely Microsoft, I'm hoping it will either place nice out of the box, or there will be a community full of people to help me make it play nice. But it has a different problem. It can take the schema out of the DB, but cannot apply it back, at least not for SQLite.
My solution? I already have Fluent NHibernate mappings for my DB, I use a separate project which uses fluent to generate the DB and then I take the DB using Entity Framework and voila! I have a quick and dirty way to play around with Entity Framework with fully compiled code... yes it is redundant... I will have the same objects in 2 projects, the ones that Fluent used to create the Database and ones Entity Framework built based on the database... but I can't complain.
Comments
Post a Comment