You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Mike Tutkowski <mi...@solidfire.com> on 2013/04/21 20:53:03 UTC

Spring Framework Question

Hi,

I'm new to the Spring Framework.  I understand the basic concepts, but am
not familiar with the details regarding how to hook up dependencies.

For example, I see this in various classes:

@Inject DiskOfferingDao diskOfferingDao;


What did we have to do in Spring (ex. files to configure) so that the
proper runtime instance of DiskOfferingDao was instantiated and assigned to
diskOfferingDao?


Thanks!

-- 
*Mike Tutkowski*
*Senior CloudStack Developer, SolidFire Inc.*
e: mike.tutkowski@solidfire.com
o: 303.746.7302
Advancing the way the world uses the
cloud<http://solidfire.com/solution/overview/?video=play>
*™*

Re: Spring Framework Question

Posted by Mike Tutkowski <mi...@solidfire.com>.
Thanks!


On Fri, Jul 5, 2013 at 7:46 PM, Soheil Eizadi <se...@infoblox.com> wrote:

> Hi Mike,
> You typically have a public interface for your DAO:
> public interface InfobloxDao extends GenericDao<InfobloxDeviceVO, Long>{
> ....
> }
>
> Then an implementation:
> public class InfobloxDaoImpl extends GenericDaoBase<InfobloxDeviceVO, Long>
>      implements InfobloxDao {
> ...
> }
>
> This is a good link for the details of Database Access:
> https://cwiki.apache.org/confluence/display/CLOUDSTACK/Data+Access+Layer
>
> The DataBase DAO is one of the Beans you register with Spring
> componentContext.xml.in:  <bean id="InfobloxDaoImpl"
> class="org.apache.cloudstack.network.dao.InfobloxDaoImpl" />
>
> Then at run time the call like the one you have below wires your
> application typically plugin to the plugin data base implementation:
> @Inject
>  InfobloxDao _infobloxDao;
>
>
> ________________________________________
> From: Mike Tutkowski [mike.tutkowski@solidfire.com]
> Sent: Sunday, April 21, 2013 11:53 AM
> To: cloudstack-dev@incubator.apache.org
> Subject: Spring Framework Question
>
> Hi,
>
> I'm new to the Spring Framework.  I understand the basic concepts, but am
> not familiar with the details regarding how to hook up dependencies.
>
> For example, I see this in various classes:
>
> @Inject DiskOfferingDao diskOfferingDao;
>
>
> What did we have to do in Spring (ex. files to configure) so that the
> proper runtime instance of DiskOfferingDao was instantiated and assigned to
> diskOfferingDao?
>
>
> Thanks!
>
> --
> *Mike Tutkowski*
> *Senior CloudStack Developer, SolidFire Inc.*
> e: mike.tutkowski@solidfire.com
> o: 303.746.7302
> Advancing the way the world uses the
> cloud<http://solidfire.com/solution/overview/?video=play>
> *™*
>



-- 
*Mike Tutkowski*
*Senior CloudStack Developer, SolidFire Inc.*
e: mike.tutkowski@solidfire.com
o: 303.746.7302
Advancing the way the world uses the
cloud<http://solidfire.com/solution/overview/?video=play>
*™*

RE: Spring Framework Question

Posted by Soheil Eizadi <se...@infoblox.com>.
Hi Mike,
You typically have a public interface for your DAO:
public interface InfobloxDao extends GenericDao<InfobloxDeviceVO, Long>{
....
}

Then an implementation:
public class InfobloxDaoImpl extends GenericDaoBase<InfobloxDeviceVO, Long>
     implements InfobloxDao {
...
}

This is a good link for the details of Database Access:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Data+Access+Layer

The DataBase DAO is one of the Beans you register with Spring
componentContext.xml.in:  <bean id="InfobloxDaoImpl" class="org.apache.cloudstack.network.dao.InfobloxDaoImpl" />

Then at run time the call like the one you have below wires your application typically plugin to the plugin data base implementation:
@Inject
 InfobloxDao _infobloxDao;


________________________________________
From: Mike Tutkowski [mike.tutkowski@solidfire.com]
Sent: Sunday, April 21, 2013 11:53 AM
To: cloudstack-dev@incubator.apache.org
Subject: Spring Framework Question

Hi,

I'm new to the Spring Framework.  I understand the basic concepts, but am
not familiar with the details regarding how to hook up dependencies.

For example, I see this in various classes:

@Inject DiskOfferingDao diskOfferingDao;


What did we have to do in Spring (ex. files to configure) so that the
proper runtime instance of DiskOfferingDao was instantiated and assigned to
diskOfferingDao?


Thanks!

--
*Mike Tutkowski*
*Senior CloudStack Developer, SolidFire Inc.*
e: mike.tutkowski@solidfire.com
o: 303.746.7302
Advancing the way the world uses the
cloud<http://solidfire.com/solution/overview/?video=play>
*™*