2009/1/14 Rick <[email protected]>:

> The problem(?) is that SqlMapClient.class is an object I don't have control
> of it's an iBATIS class that just needs a config file sent to it. Different
> DAOs I use (just two for instance) need a different load of that
> SqlMapClient class. That's waht the provider was doing was loading up the
> SqlMapClient with info from a config file.
>
> So in your example above I can't really make instances of SqlMapClient.

I'm still not sure I follow. Can't you do something like this inside a
Guice module class:

Reader reader = Resources.getResourceAsReader("ibatis.guiConfigXML");
sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);
reader.close();
bind(SqlMapClient.class).annotatedWith(Gui.class).toInstance(sqlMapClient);

and then the same for the other instance of SqlMapClient?

I don't think this is quite the same as the robot legs problem...

Apologies if I'm missing something obvious, I've only been using Guice
for a couple of months myself.

Andrew.

-- 
New site launched: http://biotext.org.uk/

I am retiring my old email addresses.
Please use [email protected] where firstname = andrew.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to