Java Reference
In-Depth Information
Second, i
BATIS
has features that allow it to effectively work with very large data
sets. i
BATIS
supports features like row handlers that allow batch processing of very
large record sets, one record at a time. It also supports fetching a range of results,
allowing you to fetch only the data absolutely necessary for your immediate needs.
If you have 10,000 records and only want records 500 to 600, then you can easily
fetch just those records. i
BATIS
supports driver hints that allow it to perform such
operations very efficiently.
Finally, i
BATIS
allows you to map your objects to the database in multiple ways.
It's pretty rare that an enterprise system functions only in a single mode. Many
enterprise-class systems need to perform transactional functions throughout the
day and perform batch functions during the night. i
BATIS
allows you to have the
same class mapped in multiple ways to ensure that each function is supported in
the most efficient way possible. i
BATIS
also supports multiple fetch strategies. That
is, you can choose to have some data loaded lazily, while other complex object
graphs are loaded with a single
SQL
join to avoid serious performance problems.
This sounds a lot like a sales pitch. So while we're in the mood, why don't we go
into some reasons why you want to use i
BATIS
? We'll do exactly that in section 2.5.
To be fair, a little later in section 2.5 we'll discuss some times when you may
not
want
to use i
BATIS
.
2.3 Why use iBATIS?
There are a great many reasons to use i
BATIS
in nearly any system. As you learned
earlier in this chapter, a framework like i
BATIS
offers opportunities to inject archi-
tectural benefits into your application. Here we'll discuss these benefits and the
features that make them possible.
2.3.1
Simplicity
i
BATIS
is widely regarded as being one of the simplest persistence frameworks
available today. Simplicity is at the heart of the design goals of the i
BATIS
team,
and it takes priority over nearly everything else. This simplicity is achieved by
maintaining a very solid foundation upon which i
BATIS
is built:
JDBC
and
SQL
.
i
BATIS
is easy for Java developers because it works like
JDBC
, only with much less
code. Almost everything you knew about
JDBC
applies to i
BATIS
as well. You can
almost think of i
BATIS
as
JDBC
code described in
XML
format. That said, i
BATIS
includes a number of other architectural benefits that
JDBC
does not have, which
we'll discuss next. i
BATIS
is also easy to understand for database administrators


