File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes Code generators, why? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Code generators, why?" Watch "Code generators, why?" New topic
Author

Code generators, why?

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

OK, first off, I love Seam.

<rant>
But I always have this major problem of code generators like seam-gen and what php and Ruby on Rails have. They never write pages that I would want in my site. They look awful, never a good UI for users, and makes it more difficult to change and overwrite what got created.

I definitely like the idea of building scaffolding for the directory structure and automatically creating build scripts, but it should stop there. Is there ever a site that you hae seen that have actually put those generated pages onto the web for public consumption?
</rant>

Thanks

Mark

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Dan Allen
Author
Ranch Hand

Joined: Mar 05, 2003
Posts: 164
I think you are slightly missing the point about the purpose of seam-gen (I can't speak for other code generators). The main goal of seam-gen is to allow you to begin evaluating Seam with next to little overhead. To make the evaluation relevant and productive, it offers a code generator so that you can get some screens together and start hacking on them (and perhaps to show your boss you actually did something). We are still a ways off (I'm not ruling it out) from when code generation can replace custom development. For that reason, seam-gen doesn't try to build the perfect application.

With all of that said, if you are looking for better code to be generated, it's easy (if you understand FreeMarker and Hibernate Tools) to modify the templates and generate more of what you want. But please don't lose focus on the fact that seam-gen is there to produce a custom example that you can build on. Seam is about much more than just seam-gen.


Dan Allen | http://mojavelinux.com | Author of Seam in Action - http://mojavelinux.com/seaminaction
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Oh, I know Seam is not just seam-gen, and my first statement says I love Seam. I used it when working on the embedded-jopr project.

I was just remarking in general about these code generators because all the different communities all glow and praise their generator and why their community makes web development such a breeze, just 10 minutes and your site is up. Where when you want to actually create a real site you ahve to go through all the pains of the learning curve and normally all take the same amount of development time. There is never a project that you can create in such a short period of time, there just isn't any projects out there that can.

Mark
Dan Allen
Author
Ranch Hand

Joined: Mar 05, 2003
Posts: 164
Exactly. If it were so easy to create projects, then the success rate of projects would be a lot higher. I do think it can be that easy to evaluate a framework though.
Padmarag Lokhande
Ranch Hand

Joined: May 29, 2008
Posts: 93
Hi Mark,
When some communities say they have a great code-generator, they mean it works for them!
That doesn't necessarily mean that they develop the complete site/app using code generators.
In a way it is good that code generators do not develop complete app - otherwise we would be out of work ;)
Generally code generators are useful only for specific repetitive tasks.


- Padmarag Lokhande
SCJP5 - http://blog.padmarag.com
Mourouganandame Arunachalam
Ranch Hand

Joined: Oct 29, 2008
Posts: 396
Code generators are always good to start new things to learn, instead of breaking head with clean white paper.


Mourougan
Open Source leads to Open Mind
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Code generators, why?
 
Similar Threads
JBoss Seam - Problems with page navigation
how is it useful for programmers?
jboss migration 4.05 to jboss 4.2.2
Problem with richfaces custom skin after ajax rendering using a4j:support
SEAM email question