ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lamey <cla...@localmatters.com>
Subject Re: Desktop apps with iBatis
Date Thu, 24 May 2007 20:26:27 GMT
On Thu, 2007-05-24 at 16:31 -0300, Caio Zanchetti wrote:
> Tank you very much for reply. I'm sorry for the long time to this
> reply.

Your welcome and don't worry:)

> Chris, can you explain a little bit more about Spring's initialization
> in a swing app? How can I do that?

Using Spring in a Swing app is easy.  Instead of initializing it via
web.xml, you have some code that starts up an application context with
the context files.  Then you can either use the context you created
directly or have classes implement the ApplicationContextAware interface
to get references to the context.

Or if I was starting from scratch now, I'd take a close look at the
Spring Rich Client framework:

http://www.springframework.org/spring-rcp

> I would like to know how to, how do you see the usage of iBatis
> without Spring integration, like in iBatis jPetStore demo app. 

Considering the iBATIS DAO framework is deprecated and the authors of
the software are urging folks to move to Spring, there would have to be
a really good reason to not use Spring.

But even if that was the case and Spring was not an option, I don't see
how the use of iBATIS differs between use in a Swing app versus a web
app.  I would still have a "service" layer that would be the main
interface into the API.  The "service" layer would use some kind of DAO
layer.  The initialization of iBATIS that occurs in JPetStore's
DaoConfig would be the same as the consuming code would use it the same.

All you'd need to do is take out the Struts specific subclasses and
'web' directory from JPetStore, and you've got a place to start.

Cheers,
topher

Mime
View raw message