September 2008

September 24: Using IBatis with Spring

Using IBatis with Springs Transactional Management Model

Finding the best approach when accessing a database in java can be a daunting task. The most common solution is to program directly to the JDBC (Java Database Connectivity) APIs. However, the result is hard to read complex code that has nothing to do with your business logic. JDBC also does nothing to address the natural differences that usually exist between an applications object model and its relational database model. The developer is left to pick up the pieces and add more code to glue these two views together.

What of Object relational mappers (ORM)? There are several implementations such as Hibernate, EJB Entities 3.0 etc. However, most of them implement full domain models mapping entire application object models to database tables.
If these mappers are too heavyweight for your needs, but you want to avoid the pitfalls of JDBC implementations in your business code, there is a simple object relational mapper framework out there that could be just what you are looking for. Instead of mapping full domain models, IBatis maps java objects directly to SQL statements. Its goal is to implement 80% of the JDBC boiler plate code that would have otherwise been left to the developer.

One of the key principals of object orientation is encapsulation. The Data Access Object (DAO) pattern is used to hide unique implementation details from the data consumer. IBatis has such a simple DAO implementation. However, although is simplicity is attractive, it has often been overlooked with a view to using the persistence abstractions offered by the Spring Framework. Springs DaoSupport class forms the basis for support for JDBC, Hibernate and IBatis. For IBatis it has a specialized implementation through the class SqlMapClientDaoSuport that makes accessing a datasource extremely simple. By introducing Spring into the mix, we can leverage her declarative transactional management model. In doing so the door opens to include Aspect Orientated Programming (AOP) injection and/or Annotations.

Collectively, IBatis leveraging the transactional capabilities of Spring, provides a robust architectural alternative to other ORM solutions or straight JDBC.

About the Speaker

Derek Parsons has, over the last 20 years, worked for some of the largest companies in the UK and USA. Apart form his considerable technical prowess; he brings real world experience to the class room as a developer, project manager and architect. Despite graduating for the University of London and obtaining a doctorate at the University of Hull, Derek has been the perpetual student, obtaining numerous technical certifications in java and project management and is a current PMP.
Since becoming a full time trainer, Derek has pushed himself to adopt some of the newer technical frameworks, to ensure that he remains up to date with industry trends. He brings his distinct “British” sense of humor to the classroom to support the communication of key aspects, giving the students a unique experience.



The event will be hosted by FCCI Insurance Group. FCCI located at 6300 University Pkwy, Sarasota, FL 34240, which is just east of exit 213 off I75.
Map It

Food and refreshments will be provided by NTier Training.

About NTier

nTier provide technical training focused on Java and related courses (OO, UML, Agile, J2EE JEE, Spring, Hibernate, JSF, Web Services etc). Services include customized training curricula built to leverage your team’s strengths and maximize classroom time. Passionate trainers that know the topic, know how to teach and develop. A great deal of emphasis in the classroom is paced on hands-on learning and best practices gained through experience. Clients include major Fortune 500 companies across the United States, in a variety of business sectors.

More Info: http://www.ntiertraining.com/index.php

Meeting Schedule

6-7PM: Food and Networking
7PM - 9PM: Presentation

Comments