--
You received this message because you are subscribed to the Google Groups "Autofac" group.
To post to this group, send email to aut...@googlegroups.com.
To unsubscribe from this group, send email to autofac+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/autofac?hl=.
To unsubscribe from this group, send email to autofac+u...@googlegroups.com.For more options, visit this group at http://groups.google.com/group/autofac?hl=en.
yes, me sorry too for delay on my side :) I'm still on it though,
hoping to complete a package during the Holidays.
That said, I'm a bit unsure on what to name this contribution. I was
thinking of using "GeneratedFactoryServices", since the IDependency
interface could be viewed as a service containing a set of generated
factories.
It doesn't feel quite right though, would like something more
descriptive...
Another approach is to think of the interface as "a strongly typed
view on IContext"... GeneratedTypedContexts, perhaps?
As you can see, I could use some input on what to name the baby :) Any
input is appreciated!
- Peter
On Dec 10, 4:09 am, Nicholas Blumhardt <nicholas.blumha...@gmail.com>
wrote:
> Hi Peter,
>
> Still think it is a funky idea :)
>
> Sorry about the delay getting back to this - if you would like to package it
> up for AutofacContrib it would be welcome!
>
> Cheers,
> Nick
>
> 2009/11/30 Peter <plillev...@gmail.com>
> > <autofac%2Bunsu...@googlegroups.com<autofac%252Bunsubscribe@googlegroup s.com>>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/autofac?hl=.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Autofac" group.
> > To post to this group, send email to aut...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > autofac+u...@googlegroups.com<autofac%2Bunsu...@googlegroups.com >
> > .
> > For more options, visit this group at
yes, me sorry too for late replies. I'm on the case though, it is not
forgotten :) I will prepare a package during the Holidays.
That said, I'm not quite certain what to call this contribution.
I've thought of calling it "GeneratedFactoryServices" since what the
"IDependency" interface really is could be viewed as a service
encapsulating one or more factories, all generated dynamically.
It could also be thought of as "a strongly typed view on the
IContext".... GeneratedTypedContexts perhaps?
Any thoughts on naming the baby would be great! :)
- Peter
On Dec 10, 4:09 am, Nicholas Blumhardt <nicholas.blumha...@gmail.com>
wrote:
> Hi Peter,
>
> Still think it is a funky idea :)
>
> Sorry about the delay getting back to this - if you would like to package it
> up for AutofacContrib it would be welcome!
>
> Cheers,
> Nick
>
> 2009/11/30 Peter <plillev...@gmail.com>
> > <autofac%2Bunsu...@googlegroups.com<autofac%252Bunsubscribe@googlegroup s.com>>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/autofac?hl=.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Autofac" group.
> > To post to this group, send email to aut...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > autofac+u...@googlegroups.com<autofac%2Bunsu...@googlegroups.com >
> > .
> > For more options, visit this group at
To unsubscribe from this group, send email to autofac+u...@googlegroups.com.
1. Using a RegistrationSource
var builder = new ContainerBuilder();
builder.RegisterSource(new
GeneratedTypedContextRegistrationSource());
builder.RegisterType<GeneratedTypedContext<IServiceLocator>>();
var container = builder.Build();
var sl = container.Resolve<IServiceLocator>();
Here we uses a GeneratedTypedContext type to indicate that the
interface should be generated. When resolved for the actual interface,
the registration source
will be consulted and looks for a
GeneratedTypedContext<IServiceLocator> registration. If found, a proxy
for the interface is generated and returned for the registration.
A helper extension method RegisterGeneratedTypedContext will be
implemented to make registration easier.
2. Using "immediate" registration
var builder = new ContainerBuilder();
builder.RegisterGeneratedTypedContext<IServiceLocator>();
var container = builder.Build();
var sl = container.Resolve<IServiceLocator>();
This approach does not rely on a registration source. The extension
method generates the proxy and registers it with the container.
So, both approaches works fine, and is almost equal in use. I find 2)
a bit easier for the end-user though, since no registration source (or
module) is involved.
Perhaps there are other advantages to registration sources?
- Peter
On 23 Des 2009, 00:35, Nicholas Blumhardt
<nicholas.blumha...@gmail.com> wrote:
> GeneratedTypedContext sounds like a good working name to me.
>
> Cheers,
> Nick
>
> 2009/12/22 Peter <plillev...@gmail.com>
> > > > <autofac%2Bunsu...@googlegroups.com<autofac%252Bunsubscribe@googlegroup s.com>
> > <autofac%252Bunsubscribe@googlegroup s.com>>
> > > > > > .
> > > > > > For more options, visit this group at
> > > > > >http://groups.google.com/group/autofac?hl=.
>
> > > > --
>
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Autofac" group.
> > > > To post to this group, send email to aut...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > autofac+u...@googlegroups.com<autofac%2Bunsu...@googlegroups.com >
> > <autofac%2Bunsu...@googlegroups.com<autofac%252Bunsubscribe@googlegroup s.com>>
> > > > .
> > > > For more options, visit this group at
To unsubscribe from this group, send email to autofac+u...@googlegroups.com.