Chapter 2. What is iBATIS?

 

This chapter covers

  • When to use iBATIS
  • When not to use iBATIS
  • Getting started
  • Future direction

In the previous chapter we discussed in detail the philosophy behind iBATIS and how the framework came to be. We also stated that iBATIS is a hybrid solution that borrows ideas from various other methods of working with a relational database. So what exactly is iBATIS? This chapter will answer that question.

iBATIS is what is known as a data mapper. In his book Patterns of Enterprise Application Architecture (Addison-Wesley Professional, 2002), Martin Fowler describes the Data Mapper pattern as follows:

A layer of Mappers[1] that moves data between objects and a database while keeping them independent of each other and the mapper itself.

1 Mapper: An object that sets up a communication between two independent objects. —Martin Fowler in Patterns of Enterprise Architecture

Martin does a good job of distinguishing between data mapping and metadata mapping, which is where an object/relational mapping tool fits in. Such a tool maps the tables and columns of the database to the classes and fields of the application. That is, an object relational mapper maps database metadata to class metadata. Figure 2.1 shows an object/relational mapping between a class and a database table. In this case, each field of the class is mapped to a single corresponding column in the database.

Figure 2.1. Object/relational mapping

2.1. Mapping SQL

 
 

2.2. How it works

 
 
 

2.3. Why use iBATIS?

 
 
 

2.4. When not to use iBATIS

 

2.5. iBATIS in five minutes

 
 

2.6. The future: where is iBATIS going?

 
 

2.7. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage