By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,238 Members | 1,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,238 IT Pros & Developers. It's quick & easy.

Code generators: Do you guys use them?

P: n/a
VMI
In the next few weeks, we'll be discussing what standards will be used
for our web development, and one of the suggestions was to use a code
generator (in our case, the first version of LLBLGen).
Personally, I don't like code generators. I inherited two web
applications that use LLBLGen, and they are just impossible to debug.
It generates so many classes and so much code that isn't actually used.
In my case, I'm maintaining web app with 235 classes (not counting the
LLBLGen folder) that basically just stores data. Also, you lose control
of what you write, you can't be creative, you can't discuss other
alternatives and have programming discussion. And what are you going to
say when you go to a job interview?

Does any have any feedback (good or bad) about these code-generating
tools?

Thanks.

Sep 18 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi

We built our own code generators with CodeDom for automating data access
layers for Oracle 10g/Lite based applications. This was initially to deal
with the frustration of continous schema evolutions which ended up breaking
our "hand-made" code. Anyway, it works great, we just say here's the
database, go generate us a new date data access layer. Any specialised
stuff we can't auto generate directly from the database either gets hand
coded in partial classes (with the help of autogenerated helper methods),
or, if demand is high enough, added to the code generator.

Our code looks how we want, behaves how we want, and it's as lean or fat as
we want it to be, and best of all, if we don't like how it's working, we
just change the code generator.

The initial downside is that you have to spend sometime upfront, actually it
took about 3 man days for the first version, but it's really paid off. It
took about five minutes for the code generator to build the necessary
(adapters, datatables, datarows and datasets) for our main business systems
200+ tables.

HTH

Glenn
"VMI" <my****@excite.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
In the next few weeks, we'll be discussing what standards will be used
for our web development, and one of the suggestions was to use a code
generator (in our case, the first version of LLBLGen).
Personally, I don't like code generators. I inherited two web
applications that use LLBLGen, and they are just impossible to debug.
It generates so many classes and so much code that isn't actually used.
In my case, I'm maintaining web app with 235 classes (not counting the
LLBLGen folder) that basically just stores data. Also, you lose control
of what you write, you can't be creative, you can't discuss other
alternatives and have programming discussion. And what are you going to
say when you go to a job interview?

Does any have any feedback (good or bad) about these code-generating
tools?

Thanks.

Sep 18 '06 #2

P: n/a
Hello VMI,

I use CodeSmith tools time to time to generate code that is used frequently.

BTW pay attention to the Web Service & Web Client Software Factories, in
your context. Not the pure codegen tool, but VSIP that mitigate your work
http://blogs.msdn.com/mpuleio/archiv...15/756796.aspx

Rather interesting tool.

VIn the next few weeks, we'll be discussing what standards will be
Vused
Vfor our web development, and one of the suggestions was to use a code
Vgenerator (in our case, the first version of LLBLGen).
VPersonally, I don't like code generators. I inherited two web
Vapplications that use LLBLGen, and they are just impossible to debug.
VIt generates so many classes and so much code that isn't actually
Vused.
VIn my case, I'm maintaining web app with 235 classes (not counting
Vthe
VLLBLGen folder) that basically just stores data. Also, you lose
Vcontrol
Vof what you write, you can't be creative, you can't discuss other
Valternatives and have programming discussion. And what are you going
Vto
Vsay when you go to a job interview?
VDoes any have any feedback (good or bad) about these code-generating
Vtools?
V>
VThanks.
V>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 18 '06 #3

P: n/a
VMI wrote:
In the next few weeks, we'll be discussing what standards will be used
for our web development, and one of the suggestions was to use a code
generator (in our case, the first version of LLBLGen).
Personally, I don't like code generators. I inherited two web
applications that use LLBLGen, and they are just impossible to debug.
It generates so many classes and so much code that isn't actually
used. In my case, I'm maintaining web app with 235 classes (not
counting the LLBLGen folder) that basically just stores data. Also,
you lose control of what you write, you can't be creative, you can't
discuss other alternatives and have programming discussion. And what
are you going to say when you go to a job interview?

Does any have any feedback (good or bad) about these code-generating
tools?
The old llblgen tool I wrote back in 2002 doesn't use templates and
generates per table a class with a couple of routines which call a
variety of stored procs, also generated.

there's a lot of redundant code in there, and because it's not
template based, it's not that customizable. However, I disagree that
it's hard to debug, as all the code you will run into is there in code
format, so you can step into it if you want, and as it's pretty
straightforward code, it's not that hard to understand as well.

The successor of LLBLGen, LLBLGen Pro, which I wrote in 2003 and is
now in its 6th revision, was rewritten from the ground up and fixes the
shortcomings of the old one, so it uses a template based code generator
engine (controlled by tasks) and uses o/r mapping to bring down the
amount of redundant code generated and also to enhance the featureset a
lot.

Code generators are a great timesaver. There are two aspects: 1) it
saves you a lot of time designing and writing code, as that's already
generated for you and 2) as it's generated code, it's already debugged
and (hopefully ;)) error free. If you would write it yourself from
scratch you will run into all the mistakes everyone makes the first
time s/he writes a dal, and also you will introduce a lot of errors (we
all do).

So I don't think it's a disadvantage to use a generator, on the
contrary: refusing to use a code generator is IMHO stubborness and
could cause trouble in the long run if competitors will use code
generators to get ahead of you.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Sep 19 '06 #4

P: n/a
"VMI" <my****@excite.comwrote in news:1158590289.546392.27580
@i42g2000cwa.googlegroups.com:
I inherited two web
applications that use LLBLGen, and they are just impossible to debug.
It generates so many classes and so much code that isn't actually used.
In my case, I'm maintaining web app with 235 classes (not counting the
LLBLGen folder) that basically just stores data. Also, you lose control
of what you write, you can't be creative, you can't discuss other
alternatives and have programming discussion. And what are you going to
say when you go to a job interview?
LLBLGen 1.2005.2 and v2.0 is great - we use them here and it cuts down
development time significantly.

LLBLGen cuts down on the need to build mundane code - the data layer :-)

Give v2.0 a try, you'll be surprised at how well it works.
Sep 19 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.