Opinions on 3rd party code generators?

R

Ronald S. Cook

On a new project, my management thought it would be a good idea to utilize a
3rd party tool to generate the database, and middle-tier classes. We chose
DeKlarit and I went to work.

While skeptical, I saw the value and proceeded. But after too many
technical problems and support headaches, I'm back to thinking its better to
just write by hand. Also, the risk of making a 3rd party product the
cornerstorn of your development technologies is high, I think.

So now we're going to look at another vendor "K2". While I'm open-minded,
I'm still firmly back to writing it all myself. Given Team Database Pro and
Windows Communication Foundation, I also now have even better tools to work
with.

If there was a 3rd party tool that all my fellow Microsoft developers
embraced and were using, then I wouldn't be so reluctant/hesitant.

Thoughts/comments?
 
D

DeveloperX

On a new project, my management thought it would be a good idea to utilize a
3rd party tool to generate the database, and middle-tier classes. We chose
DeKlarit and I went to work.

While skeptical, I saw the value and proceeded. But after too many
technical problems and support headaches, I'm back to thinking its better to
just write by hand. Also, the risk of making a 3rd party product the
cornerstorn of your development technologies is high, I think.

So now we're going to look at another vendor "K2". While I'm open-minded,
I'm still firmly back to writing it all myself. Given Team Database Pro and
Windows Communication Foundation, I also now have even better tools to work
with.

If there was a 3rd party tool that all my fellow Microsoft developers
embraced and were using, then I wouldn't be so reluctant/hesitant.

Thoughts/comments?

One other concern is that they could drive your technical agenda. I
noticed a link to the VS2003 version, and they've suspended
development on it. That rules it out for me as I'm still commercially
using 1.1 (not my choice). It's another factor that's worth thinking
about. Do you want to be driven to the next framework as fast of
possible, or woud you rather set that agenda? Do you have customers
that might need 1.1 builds and/or can you drive the adoption of a new
framework if it's internal?
What priority do 2003 bug fixes get? Lower than the new framework
would be my guess.
None of this may be relevant, just trying to be thorough :)
 
D

DeveloperX

My original post has gone AWOL, I guess it might turn up, but I can
summarise it in two words. No thanks. I'd rewrite it, but it was a bit
long. I do think it's quite important and something I have quite
strict, usually outspoken views on, so maybe tomorrow.
 
D

DeveloperX

As I've got tooth ache and can't sleep, I might as well kill some
time...
Negative points:
1) Cost. I'm not sure what it costs, but factor in support, upgrades,
initial purchase and you may be able to get a whole developer for the
money. They could own the development of these tiers and respond
immediately to changing requirements.
2) Transparency. One of the slides in the white paper shows a table
representing an invoice detail line with the name Invoice1. In other
products I've seen generically named stored procedures generated, ie
sp00000001 and similar.
3) Custom script language. Attributes are created using a custom
bastardization of c# and VB with a bit of pootang thrown in. E.g.
error(ExceptionName, "Exception message)
if InvoiceDate > System.DateTime.Now;
I wouldn't want to learn that additional syntax.
4) Appears to require a recompile if you change a business rule. There
are better ways imo which mean you can do it via a database. I can't
confirm that without playing with it, but as it seems to be done at
the dataset level it appears to be accurate.
5) The high level documentation appears to suggest they're
compensating for the developers' ability rather than accelerating
development. I make that assumption purely based on documentation that
is probably aimed at less technical decision makers. They probably
shouldn't be making this decision.
6) I would put money on you spending lots of time creating work
arounds where a specific scenario has not been catered for. This is
frustrating and time consuming. It also means you may learn to think
in terms of the framework rather than in terms of what works best.
7) I'd not heard of it, I don't want it on my CV.
8) I couldn't tell if it supported specific code conventions or not.
It looked like not. Do you want to adopt their conventions or retain
that control in house? I didn't like their conventions and found some
of the whitepapers' shoddy.
9) How had is it to write Select InvoiceID, stuff from Invoice inner
join InvoiceLine on Invoice.InvoiceId = InvoiceLine.InvoiceID? I don't
need a tool for that, I can pop it in a documented SP that includes
comments in about 20 seconds.
10) They claim you don't need to know SQL to use their tools. I can't
say I want to work on a system that uses a SQL database where the
developers don't understand SQL. Again, I've used (and use
unfortunately) tools that try and abstract the underlying access to
the database in a user friendly way. The reality is you spend lots of
time working around limitations, bugs and you need a grasp of SQL
generally over and above what you'd get by with if you didn't have to
make these decisions.
I can cite examples. Business Objects. I actually loved it when I
worked with it, but can you give me a solution to a chasm trap? Cadis.
Hate it with a passion. -- comments cause random bizarre errors like
"select field from table where field is not null" returning all nulls.
11) If you find a bug, how long before you can get it fixed? You may
end up having to manually hand fix autogenerated errors each build
until they get a patch to you.
12) Bloat. Look at some of the screenshots, it's all bloat, a
datareader and dataset for each table, then more for specific business
cases, i.e. what would traditionally be generated based on a view or
sp that serves a specific business need. Can you remove the
unnecessary ones? Do you have the time?
13) unlucky, moving on.
14) Once all this boiler plater is generated, are you good enough to
use it? A rude question I admit, but a sensible one. Lets go back to
the VB6 days; if you lived through that, you'd appreciate the false
sense of confidence a blank form you can drag buttons onto gave
interview candidates. People get upset with VB6, but it's the C# of
the previous generation. High level, easy to use and very powerful
once you get to the Curland level with a bit of Appleman for spice :)
Ok, there are huge differences, I don't want a big argument, but from
simple practical experience, I find it simpler to pick out an MFC
fraud than a C# fraud, I'm practically one myself so you'd think I'd
know...
15) Their forum was a bit of a mess. A fair few angry people, and a
number of questions that could be phrased as "In your auto-generated
code how do I work around this restriction?". I know I've been there
before, but I think it's a serious issue. Still, nice they had one,
always appreciated.
16) Support for WSE, but none for things like IBM MQ, Tibco as far as
I could tell. That could be an issue. I've only really used MQ under
DotNet, Tibco in other languages, so I may misunderstand how it's
integrated. This raises another issue though. It's possible I could
use MQ by implementing a provider and then telling their framework
about it, but I don't get that impression. That might sound daft, but
I don't feel it's got corporate developers at the heart of its vision.
 
F

Frans Bouma [C# MVP]

Ronald said:
On a new project, my management thought it would be a good idea to
utilize a 3rd party tool to generate the database, and middle-tier
classes. We chose DeKlarit and I went to work.

While skeptical, I saw the value and proceeded. But after too many
technical problems and support headaches, I'm back to thinking its
better to just write by hand. Also, the risk of making a 3rd party
product the cornerstorn of your development technologies is high, I
think.

So now we're going to look at another vendor "K2". While I'm
open-minded, I'm still firmly back to writing it all myself. Given
Team Database Pro and Windows Communication Foundation, I also now
have even better tools to work with.

What exactly are you looking for? A tool which generates DAL,BL and UI
or also the DB, or just the DAL ?

You should see code generation as a tool so you don't have to type all
the code in, it's generated for you. If the code generator generates
code you would never have written by hand that way (i.e.: it doesn't
fit the way you want to work) you should use a different code generator.

I also find it odd you're looking at K2, as they are more into the
workflow business.

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#)
------------------------------------------------------------------------
 
D

DeveloperX

What exactly are you looking for? A tool which generates DAL,BL and UI
or also the DB, or just the DAL ?

You should see code generation as a tool so you don't have to type all
the code in, it's generated for you. If the code generator generates
code you would never have written by hand that way (i.e.: it doesn't
fit the way you want to work) you should use a different code generator.

I also find it odd you're looking at K2, as they are more into the
workflow business.

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#)
------------------------------------------------------------------------

LLBGen looks interesting, I liked the code generated in the examples
on the site. One thing I didn't get from my quick perusal is how is
data validated? I.e. make sure a postcode looks like a postcode, or
order quantities aren't negative?
 
F

Frans Bouma [C# MVP]

DeveloperX said:
LLBGen looks interesting, I liked the code generated in the examples
on the site. One thing I didn't get from my quick perusal is how is
data validated? I.e. make sure a postcode looks like a postcode, or
order quantities aren't negative?

You write validator classes, which are called at runtime. For field
set actions, the validator gets a call and if the value to set is
invalid, you simply return false (so the value isn't set) or throw an
exception if you want. The validator is also used for validation
post-load, pre-save or when you call the validate routine yourself.

Currently you have to write a method in a partial class to inject a
validator object into an entity at runtime (simply overriding a
CreateValidator() method which returns an instance), or use a 3rd party
Dependency injection framework. In the upcoming version we'll add
dependency injection ourselves so it will be simply a matter of adding
an attribute to the validator class and it gets injected automatically
into an entity instance (the one of the type you specified in the
attribute).

We use the same pattern for concurrency filter generators, and in the
upcoming version also for authorization and auditing. :)

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#)
------------------------------------------------------------------------
 
D

DeveloperX

You write validator classes, which are called at runtime. For field
set actions, the validator gets a call and if the value to set is
invalid, you simply return false (so the value isn't set) or throw an
exception if you want. The validator is also used for validation
post-load, pre-save or when you call the validate routine yourself.

Currently you have to write a method in a partial class to inject a
validator object into an entity at runtime (simply overriding a
CreateValidator() method which returns an instance), or use a 3rd party
Dependency injection framework. In the upcoming version we'll add
dependency injection ourselves so it will be simply a matter of adding
an attribute to the validator class and it gets injected automatically
into an entity instance (the one of the type you specified in the
attribute).

We use the same pattern for concurrency filter generators, and in the
upcoming version also for authorization and auditing. :)

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#)
------------------------------------------------------------------------- Hide quoted text -

- Show quoted text -

That makes sense. I had a play with it last night and was impressed. I
had to do some non-IT stuff too so didn't get much beyond hooking it
up to northwind and setting up some entities while scanning the
documentation. I'll have another go over the weekend and see if I can
get it to do something :)
I'm going to try and hook it up to some of the enterprise library as
well. We use it in the office so it's something I'm familiar with and
I need to better familiarise myself with parts of the framework 2 ent
library blocks anyway so might as well kill two birds with one stone.

I had another thought on code generators in general as well. There's
one that most people have probably used built into VS as least once,
the strongly typed dataset generator. The interesting thing from my
perspective is I consider these sealed entities (probably a bad
choice of words but you get the idea) even though the code is
available.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top