﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>James Kovacs commented on Choices...</title><description>Based on the comments, it appears that a few people haven't properly analyzed an instance of the aforementioned type.
  
  
[Test]
  
public void CanExamineComplexClass() {
  
   IFooFactoryFactoryFactoryFactory fooFactoryFactoryFactoryFactory = new Factory&lt;Factory&lt;Factory&lt;Factory&lt;Factory&lt;IFooFactory&gt;&gt;&gt;&gt;&gt;();
  
  Assert.IsTrue(fooFactoryFactoryFactoryFactory is Joke);
  
}
  
  
If this was meant as a serious example, Oren would have used Boo (or written his own compiler).
</description><link>http://ayende.com/3055/choices#comment14</link><guid>http://ayende.com/3055/choices#comment14</guid><pubDate>Wed, 19 Dec 2007 20:51:11 GMT</pubDate></item><item><title>Keith Nicholas commented on Choices...</title><description>I so hope you really need that level of abstraction.
</description><link>http://ayende.com/3055/choices#comment13</link><guid>http://ayende.com/3055/choices#comment13</guid><pubDate>Wed, 19 Dec 2007 20:07:45 GMT</pubDate></item><item><title>Bryan Watts commented on Choices...</title><description>Generics allow you to describe something which, when expanded, gives you a more particular something.
  
  
In this case, you can say "IFooFactoryFactoryFactoryFactory" by saying "Factory&lt;Factory&lt;Factory&lt;Factory&lt;Factory&lt;IFooFactory&gt;&gt;&gt;&gt;&gt;", and you don't need to create (or maintain) a separate artifact.
  
  
Interfaces which embed type information are usually a less-expressive  way of saying the same thing with generics:
  
  
IStringWidget vs. IWidget&lt;string&gt;
  
  
They are synonymous!
</description><link>http://ayende.com/3055/choices#comment12</link><guid>http://ayende.com/3055/choices#comment12</guid><pubDate>Wed, 19 Dec 2007 18:23:09 GMT</pubDate></item><item><title>Mr_Simple commented on Choices...</title><description>I feel so redeemed.
</description><link>http://ayende.com/3055/choices#comment11</link><guid>http://ayende.com/3055/choices#comment11</guid><pubDate>Wed, 19 Dec 2007 16:15:39 GMT</pubDate></item><item><title>efdee commented on Choices...</title><description>I usualy prefer the first version because it allows for a more descriptive name and it keeps the implementation (using generics) hidden.
</description><link>http://ayende.com/3055/choices#comment10</link><guid>http://ayende.com/3055/choices#comment10</guid><pubDate>Wed, 19 Dec 2007 14:48:26 GMT</pubDate></item><item><title>Tapio K commented on Choices...</title><description>I need both !
  
  
Obviously 
  
  
Factory&lt;Factory&lt;Factory&lt;Factory&lt;Factory&lt;IFooFactory&gt;&gt;&gt;&gt;&gt; implements interface IFooFactoryFactoryFactoryFactory
</description><link>http://ayende.com/3055/choices#comment9</link><guid>http://ayende.com/3055/choices#comment9</guid><pubDate>Wed, 19 Dec 2007 13:10:06 GMT</pubDate></item><item><title>goodwill commented on Choices...</title><description>I think redesign is a good answer.
  
  
I will prefer #1, the #2 one is going to cause a lot of confusion on casting as Factory&lt;Factory... is a distinct type and it never cast to Factory...
</description><link>http://ayende.com/3055/choices#comment8</link><guid>http://ayende.com/3055/choices#comment8</guid><pubDate>Wed, 19 Dec 2007 09:06:22 GMT</pubDate></item><item><title>Mats Helander commented on Choices...</title><description>I'm with Nick on this one, although it seems you're also missing an AbstractFactory or two in there.
  
  
/Mats
</description><link>http://ayende.com/3055/choices#comment7</link><guid>http://ayende.com/3055/choices#comment7</guid><pubDate>Wed, 19 Dec 2007 01:20:04 GMT</pubDate></item><item><title>Nick Parker commented on Choices...</title><description>You could SO use another factory to manage all that complexity!  ;-)
</description><link>http://ayende.com/3055/choices#comment6</link><guid>http://ayende.com/3055/choices#comment6</guid><pubDate>Wed, 19 Dec 2007 01:00:23 GMT</pubDate></item><item><title>Luke Breuer commented on Choices...</title><description>I would go for the double barrel shotgun.  If you need more firepower, I'll see what I can do. :-p
</description><link>http://ayende.com/3055/choices#comment5</link><guid>http://ayende.com/3055/choices#comment5</guid><pubDate>Tue, 18 Dec 2007 23:43:36 GMT</pubDate></item><item><title>Trumpi commented on Choices...</title><description>NO NO NO NO NO!!!
  
  
It's Factory&lt;Factory&lt;Factory&lt;Hammer&gt;&gt;&gt;
  
  
(For those who don't get it, read http://discuss.joelonsoftware.com/default.asp?joel.3.219431.12)
</description><link>http://ayende.com/3055/choices#comment4</link><guid>http://ayende.com/3055/choices#comment4</guid><pubDate>Tue, 18 Dec 2007 21:45:08 GMT</pubDate></item><item><title>Peter w commented on Choices...</title><description>I like the latter, because the syntax exposes a little more detail about the type, but this is only a matter of personal preference.
  
  
I'll tell you one thing: it is a serious PITA to do the latter in XAML and it is pissing me off at the moment!!!!!!!!
</description><link>http://ayende.com/3055/choices#comment3</link><guid>http://ayende.com/3055/choices#comment3</guid><pubDate>Tue, 18 Dec 2007 21:36:33 GMT</pubDate></item><item><title>Avish commented on Choices...</title><description>Redesign.
</description><link>http://ayende.com/3055/choices#comment2</link><guid>http://ayende.com/3055/choices#comment2</guid><pubDate>Tue, 18 Dec 2007 21:31:06 GMT</pubDate></item><item><title>Bill Barry commented on Choices...</title><description>Oi...
  
  
umm, is 
  
iFooFactoryFactoryFactoryFactory : Factory&lt;Factory&lt;Factory&lt;Factory&lt;Factory&lt;IFooFactory&gt;&gt;&gt;&gt;&gt;
  
  
and are you using it more than once?
  
  
If so, then the former; btw, what is wrong that you need such a structure?
</description><link>http://ayende.com/3055/choices#comment1</link><guid>http://ayende.com/3055/choices#comment1</guid><pubDate>Tue, 18 Dec 2007 21:27:24 GMT</pubDate></item></channel></rss>