You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Alexandr Kundirenko <ak...@gmail.com> on 2005/11/15 14:21:16 UTC

Analogue for Spring "parent" attribute

Hello All,

I have many DAOs each of them accepts the same Session service:

<service-point id="PersonDao" interface="forms.IDao">
  <invoke-factory model="singleton">
    <construct class="ForumDao">
      <set-service property="session" service-id="Session"/>
      <set-object property="persistentClass" value="class:model.Person" />
    </construct>
  </invoke-factory>
</service-point>
        
<service-point id="AddressDao" interface="forms.IDao">
  <invoke-factory model="singleton">
    <construct class="AddressDao">
      <set-service property="session" service-id="Session"/>
      <set-object property="persistentClass" value="class:model.Address" />
    </construct>
  </invoke-factory>
</service-point>

Is it possible to create some "base" service-point definition with
Session injection and extend all my DAOs from it?
(Analogue for Spring "parent" attribute)

-- 
aku


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


Re: Analogue for Spring "parent" attribute

Posted by Knut Wannheden <kn...@gmail.com>.
Aku,

Note that if there is no other service with a service interface like
your Session service, then you don't need the <set-service> element in
the two service implementations of your DAO services. The Session
service should be autowired.

Regards,

--knut

On 11/15/05, Alexandr Kundirenko <ak...@gmail.com> wrote:
> Hello All,
>
> I have many DAOs each of them accepts the same Session service:
>
> <service-point id="PersonDao" interface="forms.IDao">
>   <invoke-factory model="singleton">
>     <construct class="ForumDao">
>       <set-service property="session" service-id="Session"/>
>       <set-object property="persistentClass" value="class:model.Person" />
>     </construct>
>   </invoke-factory>
> </service-point>
>
> <service-point id="AddressDao" interface="forms.IDao">
>   <invoke-factory model="singleton">
>     <construct class="AddressDao">
>       <set-service property="session" service-id="Session"/>
>       <set-object property="persistentClass" value="class:model.Address" />
>     </construct>
>   </invoke-factory>
> </service-point>
>
> Is it possible to create some "base" service-point definition with
> Session injection and extend all my DAOs from it?
> (Analogue for Spring "parent" attribute)
>
> --
> aku
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>

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


Re: Analogue for Spring "parent" attribute

Posted by Achim Hügen <ac...@gmx.de>.
Interesting idea, but there is no such option in the moment.

Achim

Am Tue, 15 Nov 2005 14:21:16 +0100 schrieb Alexandr Kundirenko  
<ak...@gmail.com>:

> Hello All,
>
> I have many DAOs each of them accepts the same Session service:
>
> <service-point id="PersonDao" interface="forms.IDao">
>   <invoke-factory model="singleton">
>     <construct class="ForumDao">
>       <set-service property="session" service-id="Session"/>
>       <set-object property="persistentClass" value="class:model.Person"  
> />
>     </construct>
>   </invoke-factory>
> </service-point>
> <service-point id="AddressDao" interface="forms.IDao">
>   <invoke-factory model="singleton">
>     <construct class="AddressDao">
>       <set-service property="session" service-id="Session"/>
>       <set-object property="persistentClass" value="class:model.Address"  
> />
>     </construct>
>   </invoke-factory>
> </service-point>
>
> Is it possible to create some "base" service-point definition with
> Session injection and extend all my DAOs from it?
> (Analogue for Spring "parent" attribute)
>



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