5 exciting things coming with Spring 3.0

In a previous blog entry I wrote about the now ancient announcement that spring 2.5 would be available. On the 2nd anniversary of that announcement I would like to examine the things I am looking forward to in Spring 3.0.

Release Announcement: 13/11/2009

5 cool things available in Spring 3.0

  1. Java 5 fully used throughout the whole API. In 2.5 the core is still Java 1.4 compatible, 3.0 is written in and requires Java 5.0. This means much greater use of generics. Unrelated but they have also included many performance enhancements.
  2. SpEL. Spring Expression Language gives access to nested bean definitions and system properties via #{…} syntax in property values. These dynamic #{…} expressions and static ${…} placeholders can also be used to inject property settings via the @Value annotation. This should much simplify property setting.
  3. Comprehensive REST support. Spring 2.5 MVC is an excellent pattern. The simplicity of annotated controllers results in very clean implementations. 3.0 takes this system further by building in Restful support and a RestTemplate for clientside REST.
  4. Spring 3.0 UI Field Formatting. Springs formatting system has always been useful in web and desktop applications. Its an effective way to remove a lot of boilerplate code from a system. This new system of annotations allows common formats to be applied to classes, model properties and methods. Check it out its very cool.
  5. Many enhancements migrating to java.util.concurrent including ThreadPoolExecutorFactoryBean which exposes the native ExecutorService interface. The concurrent package is very good indeed, so bringing more support into spring is just fantastic.

Of the 5 mentioned here its only the tip of the iceberg as regards new features. This release is very rich. As usual with spring its when you have something to solve that you really appreciate it.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Racing with Roo

In my last post I said that I would have a deeper look at Spring Roo. Well I still have not quite done that. But I did have a race to see how long it would take me to get my first website up and running with STS and Roo shell. The previous night I downloaded STS, and today I installed it on my Linux server, all very smooth no issues. Next I found a roo shell tutorial to follow: Roo Shell Tutorial Part 2 from the SpringSource blog by Ben Alex.  This uses roo from the prompt, I am going to use the shell in STS.  The challenge is to follow the tutorial and take timings to get some understanding of how difficult it is to get going with Roo.

  1. 21:45 Open Eclipse.
  2. 21:49 Updates downloaded and maven re-indexed.
  3. 21:53 Start tutorial, lots of downloads from maven after project creation.
  4. 21:55 Restart eclipse to enable the runtime weaving, STS does not return…restarted it from the prompt, deleted the project and started again as it looked incomplete.
  5. 22:00 Bumbling through the tutorial.  This is very easy, love the CTRL^space completion.  I have done quite a bit of Linux work, and this shell is very easy to use.
  6. 22:14 Running the tests using roo> perform test. This runs maven, which fails because it cant find the integration test class, RsvpIntegrationTest.  Investigation from the bash prompt reveals that all tests pass under maven, so its not an issue with the project roo has created.  More download and fiddling about.  The test runs from eclipse too, so I move on.
  7. 22:38 Website up! Selenium tests all pass.  Investigation of the functionality shows that its working!  Done in 53 mins not bad I think!
Roo Up and Running!

Roo Up and Running!

Conclusion

Yea easy, a quick look over the project shows its very neat and tidy. Most of the time was spent in download and the false start. The configuration easy to follow and the generated code would be easy to use. So yes, might have a proper look at Roo at some point! ;-)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Test anti-patterns project, contributors wanted!

Take a look at the following test class.  I deliberately wrote this poor quality test, so that I could show how easy it is to re-factor it to a better one. I was driven by having seen lots of such poor tests and to be honest I don’t want to see another of its ilk again. I might write a test like this myself, but I would never leave it like this. Its part finished. Its littered with cut and paste, poorly named methods and hard coded values. It’s a bit like a surgeon performing an operation and not sewing up the hole! I would go as far as to say that leaving tests in this state is unprofessional. There is no excuse as most of the lessons of good naming and code re-use have been written down a long time back. More lately in Clean Code by Robert C. Martin. I just don’t understand why people still write rubbish like this! Possibly because they are allowed to get away with it! Note that the test provides 100% coverage of the implementation class, but its not enough to stop there.

Have a read over the class, and then move on to read the steps to re-factor to better patterns. I have several designs here that focus on the setup stage of a test. As your tests get more complex you will find the patterns here support ever increasing complexity. In an Agile project you might move from one system to the next as the requirements ramp up. Then once you see where I am heading, I lay down a challenge.

Test anti-patterns project, contributors wanted!

If you have a Test Anti-Pattern that you would like to showcase. Check out my code from gitHub, add the new example and examples of how to re-factor the code. Blog it to your own blog with a reference to this page, or drop a comment. If we get enough I will setup a page with an index to all the blogs.

The code can be forked out with git from gitHub http://github.com/mhgit/TerribleJavaTestingMadeGood. It should be an easy start. Its a full maven project with a small dependency set and maven site reports already built in for test coverage. Its fully open source with the Apache 2.0 license. Once you have your new example, tell me about it by adding a comment to this page, and following the git forking instructions for making a git pull available.

Continue reading

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

5 reasons to upgrade Spring from 2.0 to 2.5

The 2nd anniversary of the announcement that Spring 2.5 was available is just around the corner. There are many reasons to upgrade the SpringFramework from 2.0 to 2.5. Spring 2.5 is designed as a drop-in replacement for 2.0 so there are no valid technical arguments for not upgrading.

Release Announcement: 19/11/2007

I don’t want to review all the improvements that were made, but thought it would be interesting to pick a favorite feature and explain why for me its the best feature. Perhaps some of the few remaining projects out there will move up and start taking advantage of this fantastic framework. After all, with the release notice for 3.0 RC1 back in September soon there will be reasons to upgrade again!

Continue reading

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)