I'm curious if anyone else has thoughts, ideas, etc. on this.
--Jeff
To unsubscribe from this group, send email to structuremap-us...@googlegroups.com.
1. Windsors TFF does not just work with no-arg methods. Only real
requirement is that method does not have out arguments. You can also
plug your custom logic that maps the argument to whatever you want to
pass further down the invocation pipeline. See my last post where I do
it to do something like SM's "Connect to type closing generic".
2. Func does not always cut it. You may want to pull things
differently depending on context. It's nicer to have factory with two
methods than two Func delegates. Additionally Func is unable to work
when you need generic method on non generic class.
take this sample:
public class Foo
{
private IHandlerFactory handlerFactory;//set by ctor
public void Handle<TMessage>(TMessage message)
{
var handle = handlerFactory.GetHandler<TMessage>()
handler.Handle(message);
}
}
You can't do this with Func<>.
Just my $0.02 + VAT
On 15 Mar, 21:55, "Jeremy D. Miller" <jeremydmil...@yahoo.com> wrote:
> Ok, send me your GitHub account...
>
> Jeremy D. Miller
> The Shade Tree Developer
> jeremydmil...@yahoo.com
>
> ________________________________
> From: Jimmy Bogard <jimmy.bog...@gmail.com>
> To: structure...@googlegroups.com
> Sent: Mon, March 15, 2010 3:54:05 PM
> Subject: Re: [sm-users] Re: Analog to Windsor's typed factory facility
>
> Yeah, it would do the trick, but I'm not sure I'd want to expose something like that in a public API, where I can't really guarantee that folks are using a container that supports func-y ctor args. I'm looking at something like:
>
> For<IFooFactory>().CreateFactory();
>
> Separate project it is, and there's always ilmerge...
>
> On Mon, Mar 15, 2010 at 12:36 PM, Jeremy D. Miller <jeremydmil...@yahoo.com> wrote:
>
> Jimmy,
>
> >Would just using Func<T> do the trick? That's available in 2.5.4+. I started to implement Func<string, T> too, but didn't finish it. I'm obviously very hesitant to add any dependencies, to the point of purposely duplicating code across FubuMVC and StructureMap.
>
> >People really, really dislike Windsor/Castle's dependency hell problems and I'd like to keep it out of SM. Let's put that in a separate assembly.
>
> > Jeremy D. Miller
> >The Shade Tree Developer
> >jeremydmil...@yahoo.com
>
> ________________________________
> From: Jeff Doolittle <jeffdoolit...@gmail.com>
> >To unsubscribe from this group, send email to structuremap-us...@googlegroups.com.
> >For more options, visit this group athttp://groups.google.com/group/structuremap-users?hl=en.
>
> >--
> >>You received this message because you are subscribed to the Google Groups "structuremap-users" group.
> >>To post to this group, send email to structure...@googlegroups.com.
> >>To unsubscribe from this group, send email to structuremap-us...@googlegroups.com.
>
> >For more options, visit this group athttp://groups.google.com/group/structuremap-users?hl=en.