tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Marinkovic <kristian.marinko...@porsche.co.at>
Subject Antwort: POJO dependency injection (with interface) into TAP4 application
Date Thu, 16 Mar 2006 13:50:13 GMT
hi Adam,

@InjectState("sessionDAO")
public abstract ISessionDAO getSessionDAO();

works fine too; i'm using it with tapestry-spring



                                                                           
             "Adam Zimowski"                                               
             <zimowski74@gmail                                             
             .com>                                                      An 
                                        "Tapestry users"                   
             16.03.2006 14:11           <tapestry-user@jakarta.apache.org> 
                                                                     Kopie 
                                                                           
              Bitte antworten                                        Thema 
                    an                  POJO dependency injection (with    
             "Tapestry users"           interface) into TAP4 application   
             <tapestry-user@ja                                             
             karta.apache.org>                                             
                                                                           
                                                                           
                                                                           
                                                                           




Hi there,

I'd like to inject my DAOs from Hivemind as an interface such that my
app is not aware of implementation. I only know I can do this:

<contribution configuration-id="tapestry.state.ApplicationObjects">
 <state-object name="sessionDAO" scope="application">
  <create-instance class="data.dao.SessionDAO"/>
 </state-object>
</contribution>

Then, in my class I'd do:

@InjectState("sessionDAO")
public abstract SessionDAO getSessionDAO();

I have a few problems with this:

1) I'd like to inject an interface ISessionDAO, not the concrete
implementation.

2) Question: will Hivemind give me a singleton? I don't want my DAO's
be a bunch of short lived objects. I'd like to be sure they are
singletons. I think they are because the scope is application, but I'm
not sure.

3) I'd like to be able to inject it to other POJOs, not just Tapestry
derived objects (pages, components, etc). I probably could use
Registry object, but I really prefer to do this with annotations? They
are so elegant.. Does Hivemind has annotation support ?

As always, I appreciate your help up front.

Regards,
Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Mime
View raw message