Right, here goes.
Initially I wasn't sure where to begin. I searched for "Spring Rich Client" on google, looking for a tutorial and found zero. I found the Rich Client homepage on the spring site, which was a start, and read the rather text-heavy introduction carefully.
I was rather suprised at this point that there wasn't an alpha release to download, but never mind, I suppose the framework is still in early development; and hey, I'm supposed to be a coder, and coders can handle checking out CVS, right? :)
Armed with an appropriate sense of coder machismo, I headed off to the sourceforge pages and checked out the code. Hit a hurdle trying to find the correct module name (spring-richclient, by the way - it's not mentioned on the webpage), but got there in the end by browsing the Sourceforge repository.
$ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/spring-rich-c login
$ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/spring-rich-c co -P spring-richclient
This got me the code, which looked to be a standard java project buildable with ant. Time to fire up emacs (I'm a JDE freak, away you Eclipse acolytes with your fancy iconry and easy-to-use plugins):
M-x jde-ant-build / build
So far, so good. Lots of text whirred past and I've built a version of the latest framework and packages it into three nice jars in the 'dist' directory. I've still no idea what anything does, but I'm feeling good at this point. I'm even brave enough to try running the unit tests...
M-x jde-ant-build / test
More whirring text. There are lots of tests passing, which is encouraging to a TDD fanboy. Most seem to pass without a hitch, I'm rather encouraged, then I see one failure:
Test org.springframework.richclient.security.support.DefaultSecurityControllerManagerTests FAILED
I haven't a clue what a DefaultSecurityControllerManager is, and decide to ignore it completely at this stage. I figure that if I encounter a problem later, I'll do a cvs update and see if that tests was fixed, and try again, then post to the Spring forum if it still doesn't work.
So, onto the sample application. I find a samples directory which contains 'petclinic' - most encouraging. Another build.xml - excellent:
M-x jde-ant-build / usage
Petclinic Rich sample application build file
------------------------------------------------------
Available targets are:
clean --> Clean output dirs
build --> Compile main Java sources and copy libraries
build-standalone --> Compile standalone main Java sources and copy libraries
warfile --> Create WAR deployment units
javadoc --> Create API documentation
Hmm. Clean, build and javadoc I understand, but what's with the standalone and warfile variants? This is initially rather confusing, as I figured that there wouldn't be any need to run a web application to use Spring Rich Client. I peer at the build.xml file for a bit longer, until I see the Java Web Start (JWS) references and figure the web application must just be to demonstrate a Rich Client application running through JWS.
(Note: it's only later that I saw that you need a web application because petclinic can be a client-server application - this wasn't at all clear on first read. Perhaps two samples would be clearer, rather
than combining both in the same place? Or perhaps a simple "Hello, World?" application would bridge the gap?)
I decided to take one step at a time and forget about JWS for now:
M-x jde-ant-build / build
More whirring text, with the petclinic jar placed in the 'dist' directory. Excellent - it seems all is well so far and I didn't need the web application stuff. Ok, let's give it a go. Thinking that it's ten to one I've missed something, I try:
$ java -jar petclinic-standalone.jar
Ooo. A splash screen. A frog, even better. And then, to my great delight:

Wow. JGoodies support right out of the box. I couldn't have hoped for anything better.
After clicking next a few times, and bypassing the login screen with a "Cancel", I get:

Wonderful. I've now got the source code compiling and I've a sample application I can tweak and see what happens - the only way I can really learn anything. I'm set.
A couple of thoughts before I close out this session. Firstly it's clear the bad old days of ugly java apps are over. I'm blown away by how good the application looks, for a java application. That's partly due to the wonders of JGoodies, but it looks like Spring Rich Client is going to help me produce a lovely looking application for the client. Excellent.
Secondly, I'm pleased that there really weren't that many steps for the average java developer who's used to ant to go through before getting this working. The only real hurdles were finding the right CVS module, and deciphering the ant build targets which at first glance are rather impeneterable. I'm also pleased it compiled straight from CVS and (almost) all the tests passed; a failing build, and I would have mostly likely given up there and then.
Coming soon: "Session Two: Hello, world!"
Comments
Compiling the sample application from scratch
Hey, just a note to say love the blog keep up the good work. Spring rich is a really good project and one i plan to use more and more. There are some really good posibilitys.
I finaly manged to compile the sample application after a few hours tinkering! (windows is crap, linux rules!).
One thing i wanted to point out was, that there are SVN and CVS version of the framework avalible from SourceForge, however the SVN one doesnt complie under Ant, there is no build file - the files seem to be different, or just missing some components. So to clarify, i found that i HAD to use CVS to get the files rather than using the SVN version.
There are some more ramblings about spring rich at http://www.ditchnet.org/wp/2005/05/18/remedial-spring-rich-pt-1-setting-up/ however i must stress im nothing to do with that site i just found it interesting!!
Did anyone else find the intial setup for the petclinic app confussing? I have been involved in a lot of Rails (the ruby web framework) and that has a really tidy file structure... Maybe we could do somthing similar with all spring rich apps taking a set file structure.... this works really we for rails as everyone knows where the starting point is, its not forever moving!
Cheers, again, love the blog!
Tim
Convention over Configuration
Totally agree on the file structure point. I'm big into Rails right now, and I'm loving the simplicity of setting up a new project and diving in.
clever arse
> Time to fire up emacs (I'm a JDE freak, away you Eclipse acolytes
> with your fancy iconry and easy-to-use plugins)
You're like the guy who walks around on crutches and expects special treatment because of your apparent disability. I pity your pathetic posturing and arrogant distain for modern technology. With an IDE you'd get twice as much done in half as much time. Instead you're pig headedly poking around with grep and confusing the hell out of everyone else. May the angels put a curse on you and your ilk and eternal damnation for command-line junkies.
lalalalala
*screws up eyes and puts fingers in ears*
I'm not liiiiiistening....
Seriously, I was being facetious here. I use what works best for me. Others can make their own choice of development environment.
Also, this isn't the place for an IDE flamewar. Future posts on this subject will be removed.
Chris
Need to compile petclinic sample with Java 5
I wanted to point out you need to compile the petclinic sample with Java 5, even though Spring Rich Client only seems to require java 1.4. If you try compiling petclinic with Java 1.4 you'll get the following error:
spring-richclient\samples\petclinic\src\org\springframework\richclient\samples\petclinic\ui\binder\CustomDatePickerBinder.java:25: cannot access org.jdesktop.swing.JXDatePicker
bad class file: spring-richclient\lib\jdnc\jdnc.jar(org/jdesktop/swing/JXDatePicker.class)
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
Apparently it's possible to compile against 1.4 if you replace a .jar. See http://forum.springframework.org/showthread.php?t=22282 for details.
Thanks for the info on Spring Rich Client. The lack of documentation right now is really frustrating.
Thanks for the info
I'm actually in Java 5 right now so I didn't notice, but I hope someone else is helped out by this useful comment. Anything to remove barriers to entry!
Chris