ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris O'Connell" <oconn...@gorillachicago.com>
Subject Re: iBATIS DAO vs SqlMapClientDaoSupport
Date Mon, 12 Jan 2009 21:54:15 GMT
I have used Spring to configure multiple instances of the same set of DAO's
to hit different databases.  Right there Spring has a huge advantage over
having to hardcode a specific config file right into the code.  Also, using
DI makes it easier to code against interfaces and let Spring worry about
having to instantiate the correct instance of that interface.  You haven't
indicated anything about who is actually going to be creating all the
objects you will be needing.  I'm a big fan of the rule that code should
either use an object or create it, but not both.  That doesn't necessarily
have anything to do with iBatis, but Spring's DI certainly makes that

Once again, if Spring doesn't solve any of your problems, don't use it.  But
your reasons for not using it seem a little inconsistent.  You state that
the only thing that Spring would do for you is allow you to use a Spring
utility class.  But you then state that you don't want to use DI because you
don't want clients of your API to depend on Spring.  Well, those things
really are independent of each other.  I have nothing to gain by you using
Spring, but you might want to take another look at what Spring really does
before you decide you don't want to use it.

View raw message