Code generator versus code refactoring

How do you like your CRUD programs. Generated code, wireframe driven or manually written?

+4
source share
9 answers

My experience with code generators is that they are good, but after the changes have settled, I usually want to rewrite the modules manually. Of course, this can be a maintenance problem. But it really turns into a question of a "long question." What generators, structures, and resources are you dealing with? Some of them are horrors to deal with, others work well.

+5
source

I like customizable code generators for the following reasons: Reduces coding efficiency. Easy to make global changes. Built-in architecture in templates ensures developer compliance. Less chance of coding errors. Consistent functionality Less testing.

In fact, using code generators, I was able to create or recreate storage procedures, entity classes, and DALs from a modified database with 60 + tables in minutes when the schema was updated. Using custom templates, I was sure that all layers worked with my naming rules and ensured that error handling was correct and double insertion was prevented.

Great for fixed price contracts. If it's an hour, then you can do it manually :-)

+2
source

If you are using .Net, use Linq, then it is easy to maintain. LinqToSql makes it easy to update the data model without having to change the whole code.

0
source

I like the mix of the frame, managed and hand-written. I worked a bit with NHibernate and LinqtoSql, and sometimes the queries they create for me need a little help.

0
source

It depends on the size of your application. Manual data access layers are most important for a very small application, since you have ultimate control, but for any medium or large application, I would recommend a code generator. I had experience with APEX SQL (not big), LINQ and Subsonic (both very good). I am going to evaluate ORerik ORM a little now, but I think it will be good too.

0
source

In my opinion, code generators are a sign of poor design and violate DRY. Where as a good structure you will have less code. With frameworks, you also get extension and refactoring code, not a code template.

0
source

Frames are selectable, if I need to use a code generator, I like to reset the fast Perl script that generates the code, so I understand exactly what is generated and why.

0
source

They are useful if you see your users as data entry clerks to support their database tables for you. They help minimize the programming time needed to meet the minimum requirements.

If you want the quality of your work to reflect something better, the best that can be said for them is that they can give you a hint if you are not too sure how to make simple, consistent user interface screens yourself.

Personally, I think that reorganizing them into something useful and attractive based on real-life use cases takes longer than doing it from scratch. This is the technique that the Dilbert Pointy Boss would love.

0
source

I find a good structure for CRUD logic better than code generators. I came across situations where a complex set of tables generated a very slow query to get the result.

0
source

All Articles