Hi Matthew,
Yes, DI/1 is used to wire up the controllers and the "model". For FW/1
to know about DI/1 you need to use the setBeanFactory method:
Application.cfc
// setup bean factory
var beanfactory = new frameworks.org.corfield.ioc( "/model", {
singletonPattern = "(Service|Gateway)$" } );
setBeanFactory( beanfactory );
Then, when you want something from the model injected into your
controller, just do:
property name="ContentService";
You will need to component accessors="true" enabled on the controller :)
As DI/1 serves the ContentService, it is also able to handle the
ContentService's dependency on ContentGateway etc.
ContentService.cfc
component accessors="true"{
property name="ContentGateway" getter="false";
....
}
Does that help?
Cheers,
John
On 19 September 2012 14:43, Matthew <
dduc...@gmail.com> wrote:
> I was looking at Xindi and its use of DI/1. I am trying to see where Xindi
> injects its Gateways etc into its services. Is DI/1 doing that? Trying to
> learn DI/1 and I have a simple app I built in FW/1. I have a dao and gateway
> cfcs set as properties of a service. Can I inject the two cfcs automatically
> with DI/1? Just trying to find some real world examples of DI/1 and FW/1
> use.
>
> Thank you,
> Matthew
>
> --
> You received this message because you are subscribed to the Google Groups
> "Xindi CMS" group.
> To post to this group, send an email to
getx...@googlegroups.com.
> To unsubscribe from this group, send email to
>
getxindi+u...@googlegroups.com.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msg/getxindi/-/2DgpfUO_LlUJ.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>