The Spring Blog

Engineering
Releases
News and Events

Grails and Maven: a Marriage of Inconvenience

Introduction

Grails seems to be going from strength to strength, and it looks like it definitely “has legs”, as they say. I am quite interested in stretching those legs a little outside the web application arena. If you are aware of my work on Spring Batch, you will probably be able to guess where that might take me. But for this article I wanted to just share some experiences I’ve had with the basic, low-level deployment and build of a Grails application.

I have a love/hate relationship with Maven 2, and I am learning to love Grails, but sadly the two do not play particularly well together. It would be really nice to see tighter integration. Maven is not always everything we want it to be, but there are some things that really make it worthwhile. It is a standard of sorts (love it or hate it) so when I download a project from somewhere I already know how to build it, what its dependencies are and where the documentation is. Grails has some of the same features, and in fact includes its own quite sophisticated build tool based on Groovy scripting of Ant. Maybe there is a middle way, where we can have the best of both worlds?

Read more...

Setter injection versus constructor injection and the use of @Required

A couple of month ago, we start publishing polls on www.springframework.org asking people to provide their feedback about Spring, some of its features and how they are using those features. The first question I posted was whether or not people were checking required dependencies and if so, what mechanisms they used. I quickly followed up on this question asking the community what transaction management strategy it used.

To my delight when I first checked the results, back in March, a lot of people told us by voting in the first poll that they were using the @Required annotation. The second poll–on transaction management, quickly showed that a lot of people were using the @Transactional annotation. Below you can find some of the results of the poll about checking required dependencies. Together with the poll on transaction management (about 30% of all respondents are using the @Transactional annotation to demarcate transaction boundaries) they consistently show that people are using Spring 2.0 a lot, which was very good news for us. Because upgrading an application that uses Spring 1.x to use Spring 2.0 shouldn’t be any issue, we really hoped people would not stick to Spring 1.x and in fact, people massively upgraded.

Read more...

Java EE 6 Gets it Right

The Java EE 6 proposal (JSR 316) was published today. I believe that this will be the most important revision of the platform since it was released nearly 10 years ago, and that it should be welcomed by users of the technology. Interface21 is happy to be a supporter of this JSR, and I am looking forward to contributing to it.

Java EE (known as J2EE for most of its history) has played a valuable role in creating a market for Java middleware. However, over those 10 years, important issues have emerged with the platform, such as:

Read more...

Is Open Source Dying? Case Not Proven

Michael Hickins recently published a piece on eWeek entitled Is Open Source Dying? The title drew me in, and no doubt plenty of other folk too. But the article doesn’t prove the case, although it contains some interesting points that merit discussion.

Most of the article concerns speculation about the experience of government with open source, and the motives of vendors such as IBM. I prefer to judge companies and individuals by their actions, rather than speculation about their motives, and there is plenty of evidence that IBM, for example, takes open source very seriously. There’s plenty of open source in WebSphere, for example.

Read more...

So should you still use Spring's HibernateTemplate and/or JpaTemplate??

I was reading an article by Vigil Bose on TSS the other day and saw the usage of the HibernateDaoSupport class. Since this is no longer a recommended way of using Hibernate from Spring, I thought I might as well just blog about it another time.

With the advent of Spring 2.0, it has become possible to start using the Hibernate Session API directly again. The question is whether or not it is wise to abandon the use of the HibernateTemplate when working with Hibernate, or any other template-based approaches Spring features.

Read more...

Code samples from SpringOne 'Beyond the obvious' talk

Last week at SpringOne, Alef and I gave a talk on dealing with complex applications using Spring. Complexity in this case was considered both at the structural and dynamic level. As for the structural part of the talk, I covered that one in my previous blog posting. The dynamic part explained some possible solutions to deal with differences between your deployment environments. (testing, acceptance, production, etc.)
A lot of people asked me if I could provide them with the source of the demonstrations I gave during the talk. I’ve attached the sources to this blog entry and will explain briefly how this all works. Hopefully the talk itself will eventually become available on parleys.com later this year, so you can get some more background information on the topic.

Read more...

The Power of Batch

In the last session of SpringOne yesterday, Dave Syer, Scott Wintermute, Lucas Ward and Wayne Lund all presented on Spring Batch. I didn’t actually attend (since I had an early cab ride), but I stuck my head in and was yet again astounded by the amount of interest.

Back at JavaOne we had an immense amount of interest in this solution as well, with plenty of visitors calling by the booth to quiz us about batch.

It’s all too easy in this world of Ajax and Rich Internet Applications to forget that a large number (a majority maybe?) of large scale enterprise applications are batch-oriented. Batch is like the dirty little secret that Java tries to hide from the world - but no more!

Read more...

Putting Spring Web Flow to a Load Test

Load testing a Web Flow application is similar to load testing any other web application – we’ll use a load testing tool to simulate increasing levels of concurrent client access in order to capture essential performance statistics.

With Web Flow there will be a couple of important considerations for the load test:

  1. The load test must maintain independent “cookie storage area” so each client request can carry an independent HTTP session.
  2. We need a mechanism for extracting the unique flow execution key from the initial response and use it to customize subsequent requests in the same flow session.
Read more...

Spring Framework Certified on WebSphere

SpringOne is humming along nicely. This year it’s a 3 day show, up from 2 days last year, and once again it’s great to see hundreds of attendees at a Spring conference. For once I’m quite relaxed at a show, as after the opening keynote I have no further sessions, and don’t need to work on slides.

Right now, Adrian is preparing to make a major announcement about Spring tooling. Well actually he’s giving a uniquely personal take on duck typing, as I’m sure you’ll hear…

More about that later, but first I need to share some news from yesterday. I was happy to be able to announce that we have worked with IBM to certify Spring on IBM’s flagship WebSphere Application Server. As much of Interface21’s customer base is in large enterprises, we see a lot of WebSphere and have wanted to ensure the ideal integration for years. It’s good to see that IBM share this goal. Their commitment to the integration was also largely driven by customers, many of whom have adopted Spring and experienced great results with it. As Spring adoption has moved from project-by-project to strategic, such customers want to know that this combination is supportable and that both vendors are behind it.

Read more...