Monday, 23 February 2009

Spring Web Flow and Spring MVC in one application

Share
Spring Web Flow is ideal for advanced complex page navigation and sophisticated flow controllers, but it is of no use when it comes to free browsing.

Need Spring Web Flow revision? Read my Building Spring Web Flow 2 applications with Eclipse and Maven2 post.

A perfect example of free browsing is YouTube.com. You can click in every link on the screen, copy the URL and send it to your friends.

In Spring Web Flow it cannot be done, the unique execution key passed in URL changes every page load, and the same page can have many different execution keys.

If you want your web application to be more user friendly, more restful then you have to switch to Spring MVC.

There is nothing that prevents you from using Spring Web Flow for account management and registration sub-systems, and Spring MVC for the social or public part of the same application.

Let's see how to do this!

Wednesday, 18 February 2009

Spring and Hibernate Annotations

Share
Hibernate is a very powerful ORM framework, we know it all.

With the advance of Java EE 5.0 and introduction of lightweight Java Persistence API (JPA replaced old CMP and BMP EJB 2.1 beans), Hibernate introduced a new module called Hibernate Annotations.

Hibernate Annotations is build on top of the mature Hibernate Core. It's based on the final release of the EJB 3.0/JPA specification and supports all its features (including the optional ones). Also, Hibernate Annotations supports unstandardised Hibernate specific annotations.

Today I will show you how to use Spring and Hibernate Annotations.

Friday, 13 February 2009

Cobertura test coverage Maven2 plugin

Share
Today I will continue my evangelisation on test coverage and source code quality.

Having a déjà vu? :)

Here are my previous posts about source code quality and test coverage:
In this post I will show you yet another test coverage Maven2 plugin - the Cobertura.

Tuesday, 10 February 2009

Clover2 test coverage and Maven2 plugin

Share
Today I will continue my evangelisation on test coverage and source code quality.

You may be interested in my previous posts on these topics:
And now, let's get back to Clover2!

Wednesday, 4 February 2009

Improving source code quality with Maven2 and PMD

Share
You've probably heard a lot about improving source code quality.

So this time I will skip the theoretical introduction and focus on practice.

In this post I will show you how to use PMD Maven2 plugin.

Monday, 2 February 2009

Maven profiles, filters, resources, and final artefact name

Share
Maven is very handy when it comes to parameterising builds.

In your resources you can define place holders which will be automatically resolved by Maven.
For example, in database.properties you can define:
database.username = ${profile.database.username}
database.password = ${profile.database.password}
database.url = ${profile.database.url}
and configure Maven to automatically filter and parse all of the ${profile.database.xxx} properties based on an active profile.

Let's see how to do this.

Sunday, 1 February 2009

Unit testing applications which use open session in view pattern

Share
Open session in view is more and more popular sessions and transactions programming pattern.

It is used for keeping session active in a view rendering phase.

Main problem which can be solved by using this pattern is the lazy loading problem.

No more LazyInitializationException exceptions or expensive eager fetches or copying values to/from value objects!

Here are links which will tell you more about the problem and existing solutions:
I used both of these approaches in my web applications.

I particularly find Flow Managed Persistence extremely simple and convenient to use, most of the work is simply copy and paste from Spring's manual!