Sunday, 16 November 2008

Introduction

Over the last five years, I have worked on a number of web application projects using Java and J2EE technologies. Like everyone working in this space, I spend a lot of time trying not to re-invent wheels. There are so many common tasks, from pooling database connections to managing user logins and building drop-down menus, that whatever you need to do there's a very good chance that an open-source product exists that can do it for you, or at the very least get you a long way towards your goal. This blog is a personal notebook about the software that I have worked with, and about the tricks and techniques that I have found useful. It's partly for my own use, so that I can refer back to things I've done in the past, but it's also meant for other people to use, and to add their own comments and suggestions.

The common factor in all these projects, apart from Java Enterprise Edition itself, has been the Spring framework. Spring is a layered Java/J2EE application platform, based on code published in Expert One-on-One J2EE Design and Development by Rod Johnson (Wrox, 2002). It's designed to make J2EE development simpler, and it does that by providing a common configuration mechanism which lets you wire together different Java objects to build an application. On top of the configuration mechanism, it provides components that you can use directly, for example to interface with a database access product such as Hibernate, and to manage transactions. Once you start using the configuration mechanism, variously described as an inversion-of-control container, a bean factory, or a web application context, all the other parts are optional. You can choose from a wide range of components, some of them provided with Spring, some of them from other open-source projects. Some examples are:
  • database access: either an object-relational mapping tool such as Hibernate or Toplink, or (at a lower level) JDBC access using spring's own tools;
  • web application frameworks, such as Apache Struts 2 and Spring MVC;
  • free-text indexing with Apache Lucene.
Later posts in this blog will discuss some of these components.

No comments: