<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>Funq: a fast DI container you can understand</title><link>http://funq.codeplex.com/Project/ProjectRss.aspx</link><description>This project provides a high performance DI framework by eliminating all runtime reflection through the use of lambdas and generic functions as factories.      Developed entirely in C&amp;#35; using TDD, it&amp;#39;s ...</description><item><title>New Post: Register a type without creating a concrete instance</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=55398</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Yeah it&amp;nbsp;definitely&amp;nbsp;looks like it would that approach would yield the best performance. Though would come at a cost of&amp;nbsp;additional&amp;nbsp;complexity of a post-build step and having to add an attribute and a dependency on every type you want to register. You can effectively achieve the same result with Code-Dom or T4 but I've recently been shying away from generated code if I can help it as it adds extra maintenance of managing the generated code-base, longer compile times, adding the post build step to visual studio + build agents, keeping everyone's sources in sync, debugging un-friendly ugly generated code, etc. Although this does look like it would solve some of the problems as it is a more seamless approach by mutating your code-output instead of generating added sources on the side. Being a compile-time process, I am curious about what the expected generated/mutated code would look like and how you would register it with a particular container instance? a static constructor for each type registering with a singleton container instance?&lt;/p&gt;
&lt;p&gt;Well it will definitely improve the&amp;nbsp;start-up&amp;nbsp;perf - &amp;nbsp;important for mobile apps (not so much for web apps) although I don't think that it would&amp;nbsp;yield&amp;nbsp;a significant runtime benefit to justify the additional complexity.&lt;/p&gt;
&lt;p&gt;I guess it all depends how you can integrate it into Funq, if you can wrap it up into an intuitive, non-invasive&amp;nbsp;API and still provide the ability to re-configure the container at runtime than it may be the way to go.&lt;/p&gt;&lt;/div&gt;</description><author>mythz</author><pubDate>Thu, 11 Feb 2010 00:46:56 GMT</pubDate><guid isPermaLink="false">New Post: Register a type without creating a concrete instance 20100211124656A</guid></item><item><title>New Post: Register a type without creating a concrete instance</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=55398</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;This is interesting mythz.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think the killer approach though would be to have a way to generate the strong-typed registrations at compile-time. Someone looked at ccisamples CciSharp at &lt;a href="http://ccisamples.codeplex.com/wikipage?title=CciSharp"&gt;ccisamples.codeplex.com/wikipage?title=CciSharp&lt;/a&gt;?&lt;/p&gt;&lt;/div&gt;</description><author>dcazzulino</author><pubDate>Wed, 10 Feb 2010 21:47:12 GMT</pubDate><guid isPermaLink="false">New Post: Register a type without creating a concrete instance 20100210094712P</guid></item><item><title>Commented Issue: Easy registration [2158]</title><link>http://funq.codeplex.com/WorkItem/View.aspx?WorkItemId=2158</link><description>Here&amp;#39;s the code for &amp;#34;easy&amp;#34; component registration &amp;#40;feel free to rename&amp;#41;, which is the equivalent of registering a component so that all constructor dependencies are resolved from the container via lambdas.&lt;br /&gt;&lt;br /&gt;It is implemented as a void extension method, but for general usage it would probably make sense to return IRegistration&amp;#60;T&amp;#62;&lt;br /&gt;&lt;br /&gt;http&amp;#58;&amp;#47;&amp;#47;pastie.org&amp;#47;536675&lt;br /&gt;Comments: ** Comment from web user: mythz ** &lt;p&gt;I&amp;#39;ve posted about this in the discussions but it may get lost so I&amp;#39;ll re-post&amp;#58;&lt;/p&gt;&lt;p&gt;I&amp;#39;ve developed a generics&amp;#47;expression based AutoWire wrapper for my web service framework that lets you register &amp;#39;runtime types&amp;#39; around Funq&amp;#39;s generic interfaces here&amp;#58;&lt;br /&gt;http&amp;#58;&amp;#47;&amp;#47;code.google.com&amp;#47;p&amp;#47;servicestack&amp;#47;source&amp;#47;browse&amp;#47;trunk&amp;#47;Common&amp;#47;ServiceStack.Common&amp;#47;ServiceStack.ServiceHost&amp;#47;ExpressionTypeFunqContainer.cs&lt;/p&gt;&lt;p&gt;It&amp;#39;s built with the same spirit as Funq where all the perf cost happens during the &amp;#39;registration phase&amp;#39;. Basically when you register a &amp;#39;runtime type&amp;#39; it goes through and &amp;#39;binds&amp;#39; the Funq resolver to the largest constructor and all its public properties that have registered dependencies.&lt;/p&gt;&lt;p&gt;It exposes the following API&amp;#39;s allowing you to register &amp;#39;runtime types&amp;#39;&amp;#58;&lt;/p&gt;&lt;p&gt;public void RegisterTypes&amp;#40;params Type&amp;#91;&amp;#93; serviceTypes&amp;#41;&lt;br /&gt;void RegisterTypes&amp;#40;IEnumerable&amp;#60;Type&amp;#62; serviceTypes&amp;#41;&lt;/p&gt;&lt;p&gt;At the moment it&amp;#39;s just a wrapper class around the Funq container so I could add this functionality without modifying the existing Funq code-base.&lt;br /&gt;Although if this is a useful &amp;#40;and right&amp;#41; approach I could rewrite it as an extension method or merge it into the existing code base, etc, whatever is the preferred method.&lt;br /&gt;Of course it will only work in environments that support expressions. &lt;br /&gt;I do have developed an equivalent Reflection-based solution for this purpose, although it is probably not best to include these slower API&amp;#39;s as the whole point of Funq is to run fast on embedded devices &amp;#58;&amp;#41;&lt;/p&gt;</description><author>mythz</author><pubDate>Wed, 10 Feb 2010 18:43:33 GMT</pubDate><guid isPermaLink="false">Commented Issue: Easy registration [2158] 20100210064333P</guid></item><item><title>New Post: Register a type without creating a concrete instance</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=55398</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hey kzu,&lt;/p&gt;
&lt;p&gt;Just want to say thanks for developing a really simple, clean IOC. Everything else looks over architected and it looks like you've brought the best features without the perf bloat.&lt;br&gt;I ended up replacing my existing IOC (for my opensource webservice framework) with Funq, and it's resulted in a perf boost and a cleaner and easier to use API - so thanks again.&lt;/p&gt;
&lt;p&gt;Also I'm not sure if you've done it already (haven't seen it) but I've developed a generics/expression based AutoWire wrapper around your generic interfaces here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://code.google.com/p/servicestack/source/browse/trunk/Common/ServiceStack.Common/ServiceStack.ServiceHost/ExpressionTypeFunqContainer.cs"&gt;http://code.google.com/p/servicestack/source/browse/trunk/Common/ServiceStack.Common/ServiceStack.ServiceHost/ExpressionTypeFunqContainer.cs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It's built with the same spirit as Funq where all the perf cost happens during the 'registration phase'. Basically when you register a 'runtime type' it goes through and 'binds' the Funq resolver to the largest constructor and all its public properties (which I believe is the convention).&lt;/p&gt;
&lt;p&gt;It exposes the following API's which allow you to register 'runtime types':&lt;/p&gt;
&lt;div id="_mcePaste" style="left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden"&gt;&lt;span style="white-space:pre"&gt; &lt;/span&gt;public void RegisterTypes(params Type[] serviceTypes)&lt;/div&gt;
&lt;p&gt;public void RegisterTypes(params Type[] serviceTypes)&lt;br&gt;void RegisterTypes(IEnumerable&amp;lt;Type&amp;gt; serviceTypes)&lt;/p&gt;
&lt;p&gt;Hope someone finds it Useful.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;/div&gt;</description><author>mythz</author><pubDate>Wed, 10 Feb 2010 17:14:38 GMT</pubDate><guid isPermaLink="false">New Post: Register a type without creating a concrete instance 20100210051438P</guid></item><item><title>New Post: Automatically Resolve Func&lt;TService&gt;</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=79227</link><description>&lt;div style="line-height: normal;"&gt;agreed.&lt;div&gt;&lt;div&gt;&lt;br&gt;/kzu&lt;br&gt;&lt;br&gt;--&lt;br&gt;Daniel Cazzulino | Developer Lead | XML MVP | Clarius Consulting | +1 425.329.3471&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div&gt;On Mon, Jan 4, 2010 at 00:56, mabster &lt;span dir=ltr&gt;&amp;lt;&lt;a href="mailto:notifications@codeplex.com"&gt;notifications@codeplex.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;
   &lt;div&gt; &lt;p&gt;From: mabster&lt;/p&gt; &lt;div&gt;&lt;p&gt;Well, I had a crack at implementing this but hit a brick wall pretty quickly. I think it requires some hardcore System.Linq.Expressions stuff to pull off, though it doesn't feel like it should.&lt;/p&gt;

&lt;p&gt;The beta of Autofac 2 can resolve a Lazy&amp;lt;T&amp;gt;, Func&amp;lt;T&amp;gt; and IEnumerable&amp;lt;T&amp;gt; (as well, I think, as combinations of those, like IEnumerable&amp;lt;Func&amp;lt;T&amp;gt;&amp;gt;) with only a T registered. It's an awesome feature.&lt;/p&gt;
&lt;/div&gt;&lt;div&gt; &lt;div&gt; &lt;p&gt;Read the &lt;a href="http://funq.codeplex.com/Thread/View.aspx?ThreadId=79227&amp;ANCHOR#Post272700"&gt;full discussion online&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;To add a post to this discussion, reply to this email (&lt;a href="mailto:funq@discussions.codeplex.com?subject=[funq:79227]"&gt;funq@discussions.codeplex.com&lt;/a&gt;)&lt;/p&gt;
 &lt;p&gt;To start a new discussion for this project, email &lt;a href="mailto:funq@discussions.codeplex.com"&gt;funq@discussions.codeplex.com&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You are receiving this email because you subscribed to this discussion on CodePlex. You can &lt;a href="https://funq.codeplex.com/subscriptions/thread/project/edit"&gt;unsubscribe or change your settings&lt;/a&gt; on codePlex.com.&lt;/p&gt;
 &lt;p&gt;Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at &lt;a href="http://codeplex.com"&gt;codeplex.com&lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;/blockquote&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><author>dcazzulino</author><pubDate>Mon, 04 Jan 2010 05:21:02 GMT</pubDate><guid isPermaLink="false">New Post: Automatically Resolve Func&lt;TService&gt; 20100104052102A</guid></item><item><title>New Post: Automatically Resolve Func&lt;TService&gt;</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=79227</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Well, I had a crack at implementing this but hit a brick wall pretty quickly. I think it requires some hardcore System.Linq.Expressions stuff to pull off, though it doesn't feel like it should.&lt;/p&gt;
&lt;p&gt;The beta of Autofac 2 can resolve a Lazy&amp;lt;T&amp;gt;, Func&amp;lt;T&amp;gt; and IEnumerable&amp;lt;T&amp;gt; (as well, I think, as combinations of those, like IEnumerable&amp;lt;Func&amp;lt;T&amp;gt;&amp;gt;) with only a T registered. It's an awesome feature.&lt;/p&gt;&lt;/div&gt;</description><author>mabster</author><pubDate>Mon, 04 Jan 2010 03:56:31 GMT</pubDate><guid isPermaLink="false">New Post: Automatically Resolve Func&lt;TService&gt; 20100104035631A</guid></item><item><title>New Post: Dispose problem if Owner == Container and ReuseScope == None</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=79614</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Consider the following test. It fails.&lt;/p&gt;
&lt;p&gt;It means, that in the case Owner == Container and ReuseScope == None the container doesnt guarantee, that all objects will be disposed. This problem is induced by weak references to created objects.&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color:#0000ff"&gt;class&lt;/span&gt;&amp;nbsp;Disp : IFoo, IDisposable&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color:#0000ff"&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;nbsp;i;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color:#0000ff"&gt;void&lt;/span&gt;&amp;nbsp;Dispose()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;i++;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[TestMethod]&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color:#0000ff"&gt;void&lt;/span&gt;&amp;nbsp;ContainerOwnedNonReuseInstacesAreDisposed()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;var&lt;/span&gt;&amp;nbsp;container =&amp;nbsp;&lt;span style="color:#0000ff"&gt;new&lt;/span&gt;&amp;nbsp;Container();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;container.Register&amp;lt;IFoo&amp;gt;(c =&amp;gt;&amp;nbsp;&lt;span style="color:#0000ff"&gt;new&lt;/span&gt;&amp;nbsp;Disp())&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.ReusedWithin(ReuseScope.None)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.OwnedBy(Owner.Container);&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;container.Resolve&amp;lt;IFoo&amp;gt;();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GC.Collect();&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Assert.AreEqual(1, Disp.i);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;&lt;/div&gt;</description><author>xoposhiy</author><pubDate>Sun, 03 Jan 2010 20:47:10 GMT</pubDate><guid isPermaLink="false">New Post: Dispose problem if Owner == Container and ReuseScope == None 20100103084710P</guid></item><item><title>New Post: How do I register a generic service?</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=79357</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Thanks for that information. Like mabster: what are funqlets? How can I use them? How can I write them? I've never heard about it.&lt;/p&gt;
&lt;p&gt;&amp;quot;I guess a built-in hook that would allow power users to provide this would be useful&amp;quot; =&amp;gt; yes that would be really useful. Will funq be continued in development? The last update is from Mar 30 2009 and I am using it in a couple of bussines applications that are written for the Compact Framework. So dcazzulino you are my one and only hope on my Windows Mobile projects for dependency injection ;o) All others (Ninject, OpenNETCF...) uses heavily reflection and are very slow on big business&amp;nbsp; applications.&lt;/p&gt;&lt;/div&gt;</description><author>Logdog82</author><pubDate>Sat, 02 Jan 2010 10:30:48 GMT</pubDate><guid isPermaLink="false">New Post: How do I register a generic service? 20100102103048A</guid></item><item><title>New Post: How do I register a generic service?</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=79357</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;&amp;gt; I guess a built-in hook that would allow power users to provide this would&lt;br&gt;&amp;gt; be useful... (i.e. by inheriting the Container?)&lt;/p&gt;
&lt;p&gt;I know I'd love to see some hooks into the container's internals so that I could register by passing a Type rather than calling a generic method. The generics make for much more readable code in 90% (99%?) of cases, but in the edge cases where you're using reflection to load types etc, you have to mess around with MakeGenericMethod() on the Register&amp;lt;&amp;gt; method to get it to work.&lt;/p&gt;&lt;/div&gt;</description><author>mabster</author><pubDate>Sat, 02 Jan 2010 05:17:21 GMT</pubDate><guid isPermaLink="false">New Post: How do I register a generic service? 20100102051721A</guid></item><item><title>New Post: How do I register a generic service?</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=79357</link><description>&lt;div style="line-height: normal;"&gt;they are just a way to modularize configuration for a container. It's a one-method interface that you can use to &amp;quot;register&amp;quot; the funqlet with a container, at which point the funqlet gets access to the container to add all registrations it provides. It's pretty much a clone of Autofac's modules.&lt;br clear=all&gt;
&lt;br&gt;/kzu&lt;br&gt;&lt;br&gt;--&lt;br&gt;Daniel Cazzulino | Developer Lead | XML MVP | Clarius Consulting | +1 425.329.3471&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div&gt;On Fri, Jan 1, 2010 at 23:36, mabster &lt;span dir=ltr&gt;&amp;lt;&lt;a href="mailto:notifications@codeplex.com"&gt;notifications@codeplex.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;
   &lt;div&gt; &lt;p&gt;From: mabster&lt;/p&gt; &lt;div&gt;I'd love to see some documentation, or a screencast, on funqlets. I've&lt;br&gt;seen them mentioned a few times but still don't understand what they&lt;br&gt;are.&lt;br&gt;&lt;br&gt;On 02/01/2010, dcazzulino &amp;lt;&lt;a href="mailto:notifications@codeplex.com"&gt;notifications@codeplex.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt; From: dcazzulino&lt;div&gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; nope, this is not supported out of the box, as it would require expensive&lt;br&gt;&amp;gt; reflection upon creation. you could build a funqlet that uses reflection and&lt;br&gt;&amp;gt; registers all types that are compatible for the T in the service (retrieved&lt;br&gt;
&amp;gt; via a simple linq query over reflection) and registers each one.&lt;br&gt;&amp;gt; I guess a built-in hook that would allow power users to provide this would&lt;br&gt;&amp;gt; be useful... (i.e. by inheriting the Container?)&lt;br&gt;&amp;gt; /kzu&lt;br&gt;
&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; Daniel Cazzulino | Developer Lead | XML MVP | Clarius Consulting | +1&lt;br&gt;&amp;gt; 425.329.3471&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;gt; On Wed, Dec 30, 2009 at 09:41, Logdog82 &amp;lt;[email removed]&amp;gt; wrote:&lt;br&gt;
&amp;gt;     From: Logdog82 Hi @ll,how do I register a generic service? For&lt;br&gt;&amp;gt; example:Container container = new&lt;br&gt;&amp;gt; Container();container.Register&amp;lt;IMyService&amp;lt;T&amp;gt;&amp;gt;(c =&amp;gt; new&lt;br&gt;&amp;gt; MyService&amp;lt;T&amp;gt;());IMyService&amp;lt;string&amp;gt; myService =&lt;br&gt;
&amp;gt; container.Resolve&amp;lt;IMyService&amp;lt;string&amp;gt;&amp;gt;();string foo =&lt;br&gt;&amp;gt; myService.Get&amp;lt;string&amp;gt;();In Ninject I can make something like this://&lt;br&gt;&lt;/div&gt;&amp;gt; BindingModuleBind(typeof(IMyService&amp;lt;&amp;gt;)).To(typeof(MyService&amp;lt;&amp;gt;));//&lt;br&gt;
&amp;gt; AnywhereIMyService&amp;lt;string&amp;gt; myService = ninjectKernel.Get(typeof&lt;div&gt;&lt;br&gt;&amp;gt; (IMyService&amp;lt;string&amp;gt;));string foo = myService.Get&amp;lt;string&amp;gt;();Is this also&lt;br&gt;&amp;gt; possible in Funq?  Read the full discussion online. To add a post to this&lt;br&gt;
&lt;/div&gt;&amp;gt; discussion, reply to this email ([email removed]) To start a&lt;br&gt;&amp;gt; new discussion for this project, email [email removed] You are&lt;div&gt;&lt;br&gt;&amp;gt; receiving this email because you subscribed to this discussion on CodePlex.&lt;br&gt;
&amp;gt; You can unsubscribe or change your settings on codePlex.com. Please note:&lt;br&gt;&amp;gt; Images and attachments will be removed from emails. Any posts to this&lt;br&gt;&amp;gt; discussion will also be available online at &lt;a href="http://codeplex.com"&gt;codeplex.com&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &lt;/div&gt;&lt;/div&gt;&lt;div&gt; &lt;div&gt; &lt;p&gt;Read the &lt;a href="http://funq.codeplex.com/Thread/View.aspx?ThreadId=79357&amp;ANCHOR#Post272286"&gt;full discussion online&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;To add a post to this discussion, reply to this email (&lt;a href="mailto:funq@discussions.codeplex.com?subject=[funq:79357]"&gt;funq@discussions.codeplex.com&lt;/a&gt;)&lt;/p&gt;
 &lt;p&gt;To start a new discussion for this project, email &lt;a href="mailto:funq@discussions.codeplex.com"&gt;funq@discussions.codeplex.com&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You are receiving this email because you subscribed to this discussion on CodePlex. You can &lt;a href="https://funq.codeplex.com/subscriptions/thread/project/edit"&gt;unsubscribe or change your settings&lt;/a&gt; on codePlex.com.&lt;/p&gt;
 &lt;p&gt;Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at &lt;a href="http://codeplex.com"&gt;codeplex.com&lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;/blockquote&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;</description><author>dcazzulino</author><pubDate>Sat, 02 Jan 2010 03:01:02 GMT</pubDate><guid isPermaLink="false">New Post: How do I register a generic service? 20100102030102A</guid></item><item><title>New Post: How do I register a generic service?</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=79357</link><description>&lt;div style="line-height: normal;"&gt;I'd love to see some documentation, or a screencast, on funqlets. I've&lt;br&gt;seen them mentioned a few times but still don't understand what they&lt;br&gt;are.&lt;br&gt;&lt;br&gt;On 02/01/2010, dcazzulino &amp;lt;notifications@codeplex.com&amp;gt; wrote:&lt;br&gt;&amp;gt; From: dcazzulino&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; nope, this is not supported out of the box, as it would require expensive&lt;br&gt;&amp;gt; reflection upon creation. you could build a funqlet that uses reflection and&lt;br&gt;&amp;gt; registers all types that are compatible for the T in the service (retrieved&lt;br&gt;&amp;gt; via a simple linq query over reflection) and registers each one.&lt;br&gt;&amp;gt; I guess a built-in hook that would allow power users to provide this would&lt;br&gt;&amp;gt; be useful... (i.e. by inheriting the Container?)&lt;br&gt;&amp;gt; /kzu&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; Daniel Cazzulino | Developer Lead | XML MVP | Clarius Consulting | +1&lt;br&gt;&amp;gt; 425.329.3471&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; On Wed, Dec 30, 2009 at 09:41, Logdog82 &amp;lt;[email removed]&amp;gt; wrote:&lt;br&gt;&amp;gt;     From: Logdog82 Hi @ll,how do I register a generic service? For&lt;br&gt;&amp;gt; example:Container container = new&lt;br&gt;&amp;gt; Container();container.Register&amp;lt;IMyService&amp;lt;T&amp;gt;&amp;gt;(c =&amp;gt; new&lt;br&gt;&amp;gt; MyService&amp;lt;T&amp;gt;());IMyService&amp;lt;string&amp;gt; myService =&lt;br&gt;&amp;gt; container.Resolve&amp;lt;IMyService&amp;lt;string&amp;gt;&amp;gt;();string foo =&lt;br&gt;&amp;gt; myService.Get&amp;lt;string&amp;gt;();In Ninject I can make something like this://&lt;br&gt;&amp;gt; BindingModuleBind(typeof(IMyService&amp;lt;&amp;gt;)).To(typeof(MyService&amp;lt;&amp;gt;));//&lt;br&gt;&amp;gt; AnywhereIMyService&amp;lt;string&amp;gt; myService = ninjectKernel.Get(typeof&lt;br&gt;&amp;gt; (IMyService&amp;lt;string&amp;gt;));string foo = myService.Get&amp;lt;string&amp;gt;();Is this also&lt;br&gt;&amp;gt; possible in Funq?  Read the full discussion online. To add a post to this&lt;br&gt;&amp;gt; discussion, reply to this email ([email removed]) To start a&lt;br&gt;&amp;gt; new discussion for this project, email [email removed] You are&lt;br&gt;&amp;gt; receiving this email because you subscribed to this discussion on CodePlex.&lt;br&gt;&amp;gt; You can unsubscribe or change your settings on codePlex.com. Please note:&lt;br&gt;&amp;gt; Images and attachments will be removed from emails. Any posts to this&lt;br&gt;&amp;gt; discussion will also be available online at codeplex.com&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &lt;/div&gt;</description><author>mabster</author><pubDate>Sat, 02 Jan 2010 02:36:02 GMT</pubDate><guid isPermaLink="false">New Post: How do I register a generic service? 20100102023602A</guid></item><item><title>New Post: How do I register a generic service?</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=79357</link><description>&lt;div style="line-height: normal;"&gt;nope, this is not supported out of the box, as it would require expensive reflection upon creation. &lt;div&gt;you could build a funqlet that uses reflection and registers all types that are compatible for the T in the service (retrieved via a simple linq query over reflection) and registers each one.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I guess a built-in hook that would allow power users to provide this would be useful... (i.e. by inheriting the Container?)&lt;br clear=all&gt;&lt;br&gt;/kzu&lt;br&gt;&lt;br&gt;--&lt;br&gt;Daniel Cazzulino | Developer Lead | XML MVP | Clarius Consulting | +1 425.329.3471&lt;br&gt;

&lt;br&gt;&lt;br&gt;&lt;div&gt;On Wed, Dec 30, 2009 at 09:41, Logdog82 &lt;span dir=ltr&gt;&amp;lt;&lt;a href="mailto:notifications@codeplex.com"&gt;notifications@codeplex.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;
   &lt;div&gt; &lt;p&gt;From: Logdog82&lt;/p&gt; &lt;div&gt;&lt;p&gt;Hi @ll,&lt;/p&gt;
&lt;p&gt;how do I register a generic service? For example:&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;Container container = &lt;span style="color:Blue"&gt;new&lt;/span&gt; Container();
container.Register&amp;lt;IMyService&amp;lt;T&amp;gt;&amp;gt;(c =&amp;gt; &lt;span style="color:Blue"&gt;new&lt;/span&gt; MyService&amp;lt;T&amp;gt;());
IMyService&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt; myService = container.Resolve&amp;lt;IMyService&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt;&amp;gt;();
&lt;span style="color:Blue"&gt;string&lt;/span&gt; foo = myService.Get&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt;();
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;In Ninject I can make something like this:&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;&lt;span style="color:Green"&gt;// BindingModule&lt;/span&gt;
Bind(&lt;span style="color:Blue"&gt;typeof&lt;/span&gt;(IMyService&amp;lt;&amp;gt;)).To(&lt;span style="color:Blue"&gt;typeof&lt;/span&gt;(MyService&amp;lt;&amp;gt;));
&lt;span style="color:Green"&gt;// Anywhere&lt;/span&gt;
IMyService&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt; myService = ninjectKernel.Get(&lt;span style="color:Blue"&gt;typeof&lt;/span&gt; (IMyService&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt;));
&lt;span style="color:Blue"&gt;string&lt;/span&gt; foo = myService.Get&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt;();
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Is this also possible in Funq?&lt;/p&gt;&lt;/div&gt; &lt;div&gt; &lt;p&gt;Read the &lt;a href="http://funq.codeplex.com/Thread/View.aspx?ThreadId=79357&amp;ANCHOR#Post271679"&gt;full discussion online&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;To add a post to this discussion, reply to this email (&lt;a href="mailto:funq@discussions.codeplex.com?subject=[funq:79357]"&gt;funq@discussions.codeplex.com&lt;/a&gt;)&lt;/p&gt;
 &lt;p&gt;To start a new discussion for this project, email &lt;a href="mailto:funq@discussions.codeplex.com"&gt;funq@discussions.codeplex.com&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You are receiving this email because you subscribed to this discussion on CodePlex. You can &lt;a href="https://funq.codeplex.com/subscriptions/thread/project/edit"&gt;unsubscribe or change your settings&lt;/a&gt; on codePlex.com.&lt;/p&gt;
 &lt;p&gt;Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at &lt;a href="http://codeplex.com"&gt;codeplex.com&lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/blockquote&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</description><author>dcazzulino</author><pubDate>Fri, 01 Jan 2010 22:34:12 GMT</pubDate><guid isPermaLink="false">New Post: How do I register a generic service? 20100101103412P</guid></item><item><title>New Post: How do I register a generic service?</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=79357</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi @ll,&lt;/p&gt;
&lt;p&gt;how do I register a generic service? For example:&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;Container container = &lt;span style="color:Blue"&gt;new&lt;/span&gt; Container();
container.Register&amp;lt;IMyService&amp;lt;T&amp;gt;&amp;gt;(c =&amp;gt; &lt;span style="color:Blue"&gt;new&lt;/span&gt; MyService&amp;lt;T&amp;gt;()); // not possible in Funq
IMyService&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt; myService = container.Resolve&amp;lt;IMyService&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt;&amp;gt;();
&lt;span style="color:Blue"&gt;string&lt;/span&gt; foo = myService.Get&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt;();
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;In Ninject I can make something like this:&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;&lt;span style="color:Green"&gt;// BindingModule&lt;/span&gt;
Bind(&lt;span style="color:Blue"&gt;typeof&lt;/span&gt;(IMyService&amp;lt;&amp;gt;)).To(&lt;span style="color:Blue"&gt;typeof&lt;/span&gt;(MyService&amp;lt;&amp;gt;));
&lt;span style="color:Green"&gt;// Anywhere&lt;/span&gt;
IMyService&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt; myService = ninjectKernel.Get(&lt;span style="color:Blue"&gt;typeof&lt;/span&gt; (IMyService&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt;));
&lt;span style="color:Blue"&gt;string&lt;/span&gt; foo = myService.Get&amp;lt;&lt;span style="color:Blue"&gt;string&lt;/span&gt;&amp;gt;();
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Is this also possible in Funq?&lt;/p&gt;&lt;/div&gt;</description><author>Logdog82</author><pubDate>Wed, 30 Dec 2009 12:41:25 GMT</pubDate><guid isPermaLink="false">New Post: How do I register a generic service? 20091230124125P</guid></item><item><title>New Post: Automatically Resolve Func&lt;TService&gt;</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=79227</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;A feature I've noticed in one or two other IoC frameworks, and one that would be &lt;em&gt;really&lt;/em&gt; handy, is the ability to resolve Func&amp;lt;TService&amp;gt; if TService is registered.&lt;/p&gt;
&lt;p&gt;So I could write this:&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;&lt;span style="color:Blue"&gt;var&lt;/span&gt; cont = &lt;span style="color:Blue"&gt;new&lt;/span&gt; Container();
cont.Register&amp;lt;IFoo&amp;gt;(c =&amp;gt; &lt;span style="color:Blue"&gt;new&lt;/span&gt; Foo());

&lt;span style="color:Blue"&gt;var&lt;/span&gt; fooFactory = cont.Resolve&amp;lt;Func&amp;lt;IFoo&amp;gt;&amp;gt;();&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This is a contrived example, I know, because LazyResolve would work as a substitute in this case. Where this would be really useful is when it's combined with automatic registration. So if I have a class with a Func constructor parameter, I could let Funq automatically register it and have it work out how to resolve a Func&amp;lt;T&amp;gt; for me.&lt;/p&gt;
&lt;p&gt;Would this be hard to implement? I'm thinking that the underlying implementation of Resolve&amp;lt;TService&amp;gt; (the GetEntry method) could first check if TService is registered, and if not, check if TService is itself a&amp;nbsp;Func&amp;lt;T&amp;gt; and check if T is registered.&lt;/p&gt;
&lt;p&gt;What do you think, Kzu?&lt;/p&gt;&lt;/div&gt;</description><author>mabster</author><pubDate>Tue, 29 Dec 2009 00:58:22 GMT</pubDate><guid isPermaLink="false">New Post: Automatically Resolve Func&lt;TService&gt; 20091229125822A</guid></item><item><title>New Post: IContainer</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=75046</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;When (if?) Funq gets a proper release, it &lt;a href="http://funq.codeplex.com/Thread/View.aspx?ThreadId=49109"&gt;will have Compact Framework binaries &lt;/a&gt;which would mean you could use those instead of the MAB. They'd be based off the same source as the desktop binaries so they'd have the IContainer interface.&lt;/p&gt;&lt;/div&gt;</description><author>mabster</author><pubDate>Mon, 07 Dec 2009 00:52:37 GMT</pubDate><guid isPermaLink="false">New Post: IContainer 20091207125237A</guid></item><item><title>New Post: IContainer</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=75046</link><description>&lt;div style="line-height: normal;"&gt;nop, it wouldn't make it to the MAB :(&lt;br clear=all&gt;&lt;br&gt;/kzu&lt;br&gt;&lt;br&gt;--&lt;br&gt;Daniel Cazzulino | Developer Lead | XML MVP | Clarius Consulting | +1 425.329.3471&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div&gt;On Fri, Dec 4, 2009 at 07:54, Logdog82 &lt;span dir=ltr&gt;&amp;lt;&lt;a href="mailto:notifications@codeplex.com"&gt;notifications@codeplex.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;

   &lt;div&gt; &lt;p&gt;From: Logdog82&lt;/p&gt; &lt;div&gt;&lt;p&gt;I also need this. At the moment I've mad it for myself.&lt;/p&gt;
&lt;p&gt;If you implement this, would it be also available in the mobile application block?&lt;/p&gt;&lt;/div&gt; &lt;div&gt; &lt;p&gt;Read the &lt;a href="http://funq.codeplex.com/Thread/View.aspx?ThreadId=75046&amp;ANCHOR#Post263561"&gt;full discussion online&lt;/a&gt;.&lt;/p&gt;

 &lt;p&gt;To add a post to this discussion, reply to this email (&lt;a href="mailto:funq@discussions.codeplex.com?subject=[funq:75046]"&gt;funq@discussions.codeplex.com&lt;/a&gt;)&lt;/p&gt; &lt;p&gt;To start a new discussion for this project, email &lt;a href="mailto:funq@discussions.codeplex.com"&gt;funq@discussions.codeplex.com&lt;/a&gt;&lt;/p&gt;

 &lt;p&gt;You are receiving this email because you subscribed to this discussion on CodePlex. You can &lt;a href="https://funq.codeplex.com/subscriptions/thread/project/edit"&gt;unsubscribe or change your settings&lt;/a&gt; on codePlex.com.&lt;/p&gt;

 &lt;p&gt;Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at &lt;a href="http://codeplex.com"&gt;codeplex.com&lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/blockquote&gt;

&lt;/div&gt;&lt;br&gt;&lt;/div&gt;</description><author>dcazzulino</author><pubDate>Fri, 04 Dec 2009 20:00:06 GMT</pubDate><guid isPermaLink="false">New Post: IContainer 20091204080006P</guid></item><item><title>New Post: IContainer</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=75046</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I also need this. At the moment I've mad it for myself.&lt;/p&gt;
&lt;p&gt;If you implement this, would it be also available in the mobile application block?&lt;/p&gt;&lt;/div&gt;</description><author>Logdog82</author><pubDate>Fri, 04 Dec 2009 10:54:22 GMT</pubDate><guid isPermaLink="false">New Post: IContainer 20091204105422A</guid></item><item><title>New Post: Dependencies and DefaultReuse - need advice</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=76256</link><description>&lt;div style="line-height: normal;"&gt;
&lt;div&gt;
&lt;div&gt;Yeah neither is true, but I guess the fact that DefaultReuse isn't &amp;quot;None&amp;quot; 
by default had me thinking that caching instances of everything was the 
preferred way to go. Certainly it's not expensive to create everything down the 
dependency tree each time it's needed.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Matt&lt;/div&gt;&lt;/div&gt;
&lt;div style="font:10pt Tahoma"&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div style="background:#f5f5f5"&gt;
&lt;div style="font-color:black"&gt;&lt;b&gt;From:&lt;/b&gt; [email removed] &lt;/div&gt;
&lt;div&gt;&lt;b&gt;Sent:&lt;/b&gt; Sunday, November 29, 2009 11:12 PM&lt;/div&gt;
&lt;div&gt;&lt;b&gt;To:&lt;/b&gt; [email removed] &lt;/div&gt;
&lt;div&gt;&lt;b&gt;Subject:&lt;/b&gt; Re: Dependencies and DefaultReuse - need advice 
[funq:76256]&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;


&lt;p&gt;From: dcazzulino&lt;/p&gt;
&lt;div id=ThreadNotificationPostBody&gt;unless repository object creation is 
expensive or holds to unmanaged resources for its lifetime (which it shouldn't 
IMO), I don't see a problem in re-creating it every time. &lt;br clear=all&gt;&lt;br&gt;/kzu&lt;br&gt;&lt;br&gt;--&lt;br&gt;Daniel Cazzulino | Developer Lead | XML MVP | 
Clarius Consulting | +1 425.329.3471&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;div&gt;On Sat, Nov 28, 2009 at 15:09, mabster &lt;span dir=ltr&gt;&amp;lt;&lt;a href="mailto:notifications@codeplex.com"&gt;notifications@codeplex.com&lt;/a&gt;&amp;gt;&lt;/span&gt; 
wrote:&lt;br&gt;
&lt;blockquote style="margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"&gt;
  &lt;div&gt;
  &lt;p&gt;From: mabster&lt;/p&gt;
  &lt;div&gt;
  &lt;p&gt;Hi guys,&lt;/p&gt;
  &lt;p&gt;I have an application in which a lot of classes ultimately depend on 
  repository objects. These repositories are constructed by passing in a server 
  name which they use to build the URI for the web services they talk to. I've 
  added the server name to the project's user properties, so my repositories are 
  registered like this:&lt;/p&gt;
  &lt;div style="background-color:white;color:black"&gt;&lt;pre&gt;container.Register&amp;lt;IFooRepository&amp;gt;(
    c =&amp;gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; FooRepository(Properties.Settings.Default.Server);
&lt;/pre&gt;&lt;/div&gt;
  &lt;p&gt;It's a bit clunky, but it works.&lt;/p&gt;
  &lt;p&gt;The problem I have is that the user could decide to change the server at 
  any time, and when they do so, any existing repositories are invalid. To get 
  around this problem I've set the DefaultReuse on the container to &amp;quot;None&amp;quot; so 
  that everything's constructed new every time it's requested.&lt;/p&gt;
  &lt;p&gt;Can someone suggest a way that I could reuse my repository classes (and 
  therefore all the classes that have them as dependencies) as long as the 
  Server setting doesn't change? Once the user changes the server, I need the 
  next call to container.Resolve&amp;lt;IFooRepository&amp;gt;() to return a new 
  instance using the new server name.&lt;/p&gt;
  &lt;p&gt;I was thinking of registering the default settings as an instance in a 
  &amp;quot;parent&amp;quot; container, and giving my application a way to spawn off a child 
  container with all the repositories registered in it. Whenever the server name 
  changed, the app would ditch that child container and create another one. This 
  doesn't seem practical, though, because it feels like my app would have to 
  have too much &amp;quot;knowledge&amp;quot; about containers (so that it could re-create one 
  when the options dialog closes).&lt;/p&gt;&lt;/div&gt;
  &lt;div&gt;
  &lt;p&gt;Read the &lt;a href="http://funq.codeplex.com/Thread/View.aspx?ThreadId=76256&amp;ANCHOR#Post260727"&gt;full 
  discussion online&lt;/a&gt;.&lt;/p&gt;
  &lt;p&gt;To add a post to this discussion, reply to this email (&lt;a href="mailto:funq@discussions.codeplex.com?subject=[funq:76256]"&gt;funq@discussions.codeplex.com&lt;/a&gt;)&lt;/p&gt;
  &lt;p&gt;To start a new discussion for this project, email &lt;a href="mailto:funq@discussions.codeplex.com"&gt;funq@discussions.codeplex.com&lt;/a&gt;&lt;/p&gt;
  &lt;p&gt;You are receiving this email because you subscribed to this discussion on 
  CodePlex. You can &lt;a href="https://funq.codeplex.com/subscriptions/thread/project/edit"&gt;unsubscribe 
  or change your settings&lt;/a&gt; on codePlex.com.&lt;/p&gt;
  &lt;p&gt;Please note: Images and attachments will be removed from emails. Any posts 
  to this discussion will also be available online at &lt;a href="http://codeplex.com"&gt;codeplex.com&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;</description><author>mabster</author><pubDate>Sun, 29 Nov 2009 21:20:27 GMT</pubDate><guid isPermaLink="false">New Post: Dependencies and DefaultReuse - need advice 20091129092027P</guid></item><item><title>New Post: Dependencies and DefaultReuse - need advice</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=76256</link><description>&lt;div style="line-height: normal;"&gt;unless repository object creation is expensive or holds to unmanaged resources for its lifetime (which it shouldn't IMO), I don't see a problem in re-creating it every time. &lt;br clear=all&gt;&lt;br&gt;/kzu&lt;br&gt;&lt;br&gt;--&lt;br&gt;Daniel Cazzulino | Developer Lead | XML MVP | Clarius Consulting | +1 425.329.3471&lt;br&gt;


&lt;br&gt;&lt;br&gt;&lt;div&gt;On Sat, Nov 28, 2009 at 15:09, mabster &lt;span dir=ltr&gt;&amp;lt;&lt;a href="mailto:notifications@codeplex.com"&gt;notifications@codeplex.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote style="margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"&gt;

   &lt;div&gt; &lt;p&gt;From: mabster&lt;/p&gt; &lt;div&gt;&lt;p&gt;Hi guys,&lt;/p&gt;
&lt;p&gt;I have an application in which a lot of classes ultimately depend on repository objects. These repositories are constructed by passing in a server name which they use to build the URI for the web services they talk to. I've added the server name to the project's user properties, so my repositories are registered like this:&lt;/p&gt;


&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;container.Register&amp;lt;IFooRepository&amp;gt;(
    c =&amp;gt; &lt;span style="color:Blue"&gt;new&lt;/span&gt; FooRepository(Properties.Settings.Default.Server);
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;It's a bit clunky, but it works.&lt;/p&gt;
&lt;p&gt;The problem I have is that the user could decide to change the server at any time, and when they do so, any existing repositories are invalid. To get around this problem I've set the DefaultReuse on the container to &amp;quot;None&amp;quot; so that everything's constructed new every time it's requested.&lt;/p&gt;


&lt;p&gt;Can someone suggest a way that I could reuse my repository classes (and therefore all the classes that have them as dependencies) as long as the Server setting doesn't change? Once the user changes the server, I need the next call to container.Resolve&amp;lt;IFooRepository&amp;gt;() to return a new instance using the new server name.&lt;/p&gt;


&lt;p&gt;I was thinking of registering the default settings as an instance in a &amp;quot;parent&amp;quot; container, and giving my application a way to spawn off a child container with all the repositories registered in it. Whenever the server name changed, the app would ditch that child container and create another one. This doesn't seem practical, though, because it feels like my app would have to have too much &amp;quot;knowledge&amp;quot; about containers (so that it could re-create one when the options dialog closes).&lt;/p&gt;

&lt;/div&gt; &lt;div&gt; &lt;p&gt;Read the &lt;a href="http://funq.codeplex.com/Thread/View.aspx?ThreadId=76256&amp;ANCHOR#Post260727"&gt;full discussion online&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;To add a post to this discussion, reply to this email (&lt;a href="mailto:funq@discussions.codeplex.com?subject=[funq:76256]"&gt;funq@discussions.codeplex.com&lt;/a&gt;)&lt;/p&gt;

 &lt;p&gt;To start a new discussion for this project, email &lt;a href="mailto:funq@discussions.codeplex.com"&gt;funq@discussions.codeplex.com&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You are receiving this email because you subscribed to this discussion on CodePlex. You can &lt;a href="https://funq.codeplex.com/subscriptions/thread/project/edit"&gt;unsubscribe or change your settings&lt;/a&gt; on codePlex.com.&lt;/p&gt;

 &lt;p&gt;Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at &lt;a href="http://codeplex.com"&gt;codeplex.com&lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/blockquote&gt;

&lt;/div&gt;&lt;br&gt;&lt;/div&gt;</description><author>dcazzulino</author><pubDate>Sun, 29 Nov 2009 12:12:37 GMT</pubDate><guid isPermaLink="false">New Post: Dependencies and DefaultReuse - need advice 20091129121237P</guid></item><item><title>New Post: Dependencies and DefaultReuse - need advice</title><link>http://funq.codeplex.com/Thread/View.aspx?ThreadId=76256</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi guys,&lt;/p&gt;
&lt;p&gt;I have an application in which a lot of classes ultimately depend on repository objects. These repositories are constructed by passing in a server name which they use to build the URI for the web services they talk to. I've added the server name to the project's user properties, so my repositories are registered like this:&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;container.Register&amp;lt;IFooRepository&amp;gt;(
    c =&amp;gt; &lt;span style="color:Blue"&gt;new&lt;/span&gt; FooRepository(Properties.Settings.Default.Server);
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;It's a bit clunky, but it works.&lt;/p&gt;
&lt;p&gt;The problem I have is that the user could decide to change the server at any time, and when they do so, any existing repositories are invalid. To get around this problem I've set the DefaultReuse on the container to &amp;quot;None&amp;quot; so that everything's constructed new every time it's requested.&lt;/p&gt;
&lt;p&gt;Can someone suggest a way that I could reuse my repository classes (and therefore all the classes that have them as dependencies) as long as the Server setting doesn't change? Once the user changes the server, I need the next call to container.Resolve&amp;lt;IFooRepository&amp;gt;() to return a new instance using the new server name.&lt;/p&gt;
&lt;p&gt;I was thinking of registering the default settings as an instance in a &amp;quot;parent&amp;quot; container, and giving my application a way to spawn off a child container with all the repositories registered in it. Whenever the server name changed, the app would ditch that child container and create another one. This doesn't seem practical, though, because it feels like my app would have to have too much &amp;quot;knowledge&amp;quot; about containers (so that it could re-create one when the options dialog closes).&lt;/p&gt;&lt;/div&gt;</description><author>mabster</author><pubDate>Wed, 25 Nov 2009 21:31:57 GMT</pubDate><guid isPermaLink="false">New Post: Dependencies and DefaultReuse - need advice 20091125093157P</guid></item></channel></rss>