Friday, March 17, 2006

Spring MVC + Hibernate?

A couple months ago, when I was still working at CUCBC, Scott gave an awesome presentation called, I think "Java on Rails", that showed how Hibernate and JSF could be used to build simple webapps in Java almost as quickly as Rails allows you to do in Ruby. Today, a co-worker here just did a presentation on the Spring MVC framework, which looks very impressive.

I'm wondering again if I'll be able to find the time to put these tools to use building... well, I don't want to give it away. ;)

It looks like the general process is this:
1. Build out your database schema
2. Use in ant to create the hibernate mappings and POJOS:
<hibernatetool destdir="generated">
<jdbcconfiguration packagename="com.lewisd"
<hbm2cfgxml />
<hbm2hbmxml />
<hbm2java jdk5="true" />

3. Extend the POJOs with whatever finder/lookup methods you need, or put them in some other class maybe.
4. Use Spring MVC and the Spring Framework to tie everything together.

Apparently Spring MVC even has some cool stuff for doing "Wizards", as they're called. Complex forms.
I hear the tags it uses for forms wrap around regular HTML tags, rather than replacing them. Sounds interesting.

No comments: