<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>AutoPoco</title>
        <link>http://www.codeofrob.com/category/11.aspx</link>
        <description>Blog posts on the OSS - AutoPoco</description>
        <language>en-GB</language>
        <copyright>Rob Ashton</copyright>
        <generator>Subtext Version 2.1.2.2</generator>
        <item>
            <title>AutoPoco 0.4 released - features features features</title>
            <link>http://codeofrob.com/archive/2010/04/15/autopoco-0.4-released-features-features-features.aspx</link>
            <description>&lt;p&gt;What's that? I skipped a number? Actually I didn't, but 0.3 wasn't particularly major so making a blog entry seemed a bit redundant :)&lt;/p&gt;
&lt;p&gt;What have I added? Glad you asked:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Method Invocation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;During configuration, you can now set up data sources for parameters of methods, just pass in raw values or just call a method with no arguments.&lt;/p&gt;
&lt;p&gt;It's all been done in a strongly-typed manner to fit in with the rest of AutoPoco.&lt;/p&gt;
&lt;pre class="brush: csharp;" title="code"&gt;                x.Include&amp;lt;SimpleMethodClass&amp;gt;()
                    .Invoke(c =&amp;gt; c.SetSomething(
                        Use.Source&amp;lt;String, RandomStringSource&amp;gt;(5, 10),
                        Use.Source&amp;lt;String, LastNameSource&amp;gt;()))
                    .Invoke(c =&amp;gt; c.DoSomething());&lt;/pre&gt;
&lt;p&gt;Obviously this needs a brother to override this configuration at the time of object creation, and that looks something like this:&lt;/p&gt;
&lt;pre class="brush: csharp;" title="code"&gt;            IList&amp;lt;SimpleMethodClass&amp;gt; items = mSession.List&amp;lt;SimpleMethodClass&amp;gt;(100)
                    .Invoke(x =&amp;gt; x.SetSomething("Something"))   
                .Get();&lt;/pre&gt;
&lt;p&gt;And this will call SetSomething on all the created objects with the argument "Something" - this set of functionality is for those who don't have accessible setters on public properties but still wish to invoke them. The alternative was to start proxying around the objects and demanding that properties be virtual - but unless somebody says otherwise, I think that's a bit heavyweight for this sort of library.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Improved Convention Support&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Conventions have been baked into AutoPoco from the start, but weren't fleshed out until this iteration, they can be used to match types of property/field, or match the names of properties/fields (or both) and apply rules to them without any knowledge of the specific type being configured.&lt;/p&gt;
&lt;p&gt;This is useful for those with multiple projections of their domain, which follow naming conventions throughout the project.&lt;/p&gt;
&lt;pre class="brush: csharp;" title="code"&gt;    public class EmailAddressPropertyConvention : ITypePropertyConvention
    {
        public void Apply(ITypePropertyConventionContext context)
        {
            context.SetSource&amp;lt;EmailAddressSource&amp;gt;();
        }

        public void SpecifyRequirements(ITypeMemberConventionRequirements requirements)
        {
            requirements.Name(x =&amp;gt; String.Compare(x, "EmailAddress", true) == 0);
            requirements.Type(x =&amp;gt; x == typeof(String));
        }
    }&lt;/pre&gt;
&lt;p&gt;This convention will match any property of type string called EmailAddress and apply the EmailAddressSource to it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Inheritance&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This was more complicated to deal with, and I expect to be writing a couple of quick blog entries detailing some of the gotchas encountered when writing the code for this, as googling didn't really provide the answers I was looking for (My first port of call for all problems)&lt;/p&gt;
&lt;p&gt;The gist of it, is that if you have an interface with a property, and you define a rule for that property, then any class that implements that property will also inherit that rule (the same goes for base classes and their properties).&lt;/p&gt;
&lt;p&gt;If a rule is defined for that specific derived class, then it will override the rule provided by the interface or base class. The only thing I haven't expliclty included in this is open generics, because they're a bit more tricky to come up with an elegant solution for.&lt;/p&gt;
&lt;p&gt;Consider the following class structure:&lt;/p&gt;
&lt;pre class="brush: csharp;" title="code"&gt;    public interface ISimpleInterface
    {
        string InterfaceValue
        {
            get;
            set;
        }

        string OtherInterfaceValue
        {
            get;
            set;
        }
    }

    public class SimpleBaseClass : ISimpleInterface
    {
        public string BaseProperty
        {
            get;
            set;
        }

        public virtual string BaseVirtualProperty
        {
            get;
            set;
        }
    
        public string InterfaceValue
        {
	      set;
          get;
        }
        
        public string OtherInterfaceValue
        {
            get;
            set;
        }
    }

    public class SimpleDerivedClass : SimpleBaseClass, ISimpleInterface
    {
        public string Name
        {
            get;
            set;
        }

        public override string BaseVirtualProperty
        {
            get;
            set;
        }
    }&lt;/pre&gt;
&lt;p&gt;With the following configuration&lt;/p&gt;
&lt;pre class="brush: csharp;" title="code"&gt;                x.Include&amp;lt;ISimpleInterface&amp;gt;()
                    .Setup(c =&amp;gt; c.InterfaceValue).Value("InterfaceValue - ISimpleInterface")
                    .Setup(c=&amp;gt;c.OtherInterfaceValue).Value("OtherInterfaceValue - ISimpleInterface");
                 x.Include&amp;lt;SimpleBaseClass&amp;gt;()
                    .Setup(c =&amp;gt; c.BaseProperty).Value("BaseProperty - SimpleBaseClass")
                    .Setup(c =&amp;gt; c.BaseVirtualProperty).Value("BaseVirtualProperty - SimpleBaseClass");
                x.Include&amp;lt;SimpleDerivedClass&amp;gt;()
                    .Setup(c =&amp;gt; c.Name).Value("OtherTest")
                    .Setup(c =&amp;gt; c.BaseVirtualProperty).Value("BaseVirtualProperty - SimpleDerivedClass")
                    .Setup(c =&amp;gt; c.OtherInterfaceValue).Value("OtherInterfaceValue - SimpleDerivedClass");&lt;/pre&gt;
&lt;p class="brush: csharp;" title="code"&gt;Requesting a SimpleBaseClass, we get&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;BaseProperty: "BaseProperty - SimpleBaseClass"&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;BaseVirtualProperty: "BaseVirtualProperty - SimpleBaseClass"&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;InterfaceValue: "InterfaceValue - ISimpleInterface"&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;OtherInterfaceValue:  "OtherInterfaceValue - ISimpleInterface"&lt;/div&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;p class="brush: csharp;" title="code"&gt;Requesting a SimpleDerivedClass, we get&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;BaseProperty: "BaseProperty - SimpleBaseClass"&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;BaseVirtualProperty: "BaseVirtualProperty - SimpleDerivedClass"&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;InterfaceValue: "InterfaceValue - ISimpleInterface"&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;OtherInterfaceValue: "OtherInterfaceValue - SimpleDerivedClass"&lt;/div&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;p class="brush: csharp;" title="code"&gt;It looks a bit complicated up front, but it makes sense if you think about it and that's what matters (the functionality is there if you need it, if you don't need it then you don't need to worry about it).&lt;/p&gt;
&lt;p class="brush: csharp;" title="code"&gt;&lt;strong&gt;More data sources&lt;/strong&gt;&lt;/p&gt;
&lt;p class="brush: csharp;" title="code"&gt;I was expecting to have to do these myself, along with a load of standard property/field conventions - but I had an e-mail from &lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;&lt;a href="http://www.codeplex.com/site/users/view/Birdchest"&gt;Khalid Abuhakme&lt;/a&gt; letting me know he'd created a fork with some standard data sources in them.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;I have pulled them through and now our list of data sources looks something like this:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;ColorSource&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;CountrySource&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;CreditCardSource&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;DataOfBirthSource&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;EmailAddressSource&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;EnumerableSource&amp;lt;T&amp;gt; where T : IDataSource (Really cool addition Khalid!)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;FirstNameSource&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;LastNameSource&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;LorumIpsumSource&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;RandomStringSource&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;div class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;UsStatesSource&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;p class="brush: csharp;" title="code"&gt;&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px" class="Apple-style-span"&gt;We'll end up with a lot more of these for sure, and still need a more customisable aspect to some of the default ones, but if anybody else wants to contribute then feel free, as adding conventions and data sources is what will make AutoPoco really useful.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://codeofrob.com/aggbug/20.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rob Ashton</dc:creator>
            <guid>http://codeofrob.com/archive/2010/04/15/autopoco-0.4-released-features-features-features.aspx</guid>
            <pubDate>Thu, 15 Apr 2010 08:19:25 GMT</pubDate>
            <wfw:comment>http://codeofrob.com/comments/20.aspx</wfw:comment>
            <comments>http://codeofrob.com/archive/2010/04/15/autopoco-0.4-released-features-features-features.aspx#feedback</comments>
            <wfw:commentRss>http://codeofrob.com/comments/commentRss/20.aspx</wfw:commentRss>
            <trackback:ping>http://codeofrob.com/services/trackbacks/20.aspx</trackback:ping>
        </item>
        <item>
            <title>Why diversity and choice are good things</title>
            <link>http://codeofrob.com/archive/2010/04/09/why-diversity-and-choice-are-good-things.aspx</link>
            <description>&lt;p&gt;I noticed a bit of traffic coming from somewhere I didn't recognise, so I went over to check it out...&lt;/p&gt;
&lt;p&gt;It was just ranty link bait so I won't bother linking it&lt;a href="http://thesoftwaresimpleton.blogspot.com/2010/04/invention-is-not-invented-here.html"&gt;,&lt;/a&gt; but it reminded me of a stance I took a few years ago while I was still just using the MS provided frameworks and software like a good little drone...&lt;/p&gt;
&lt;p&gt;Starting with the obvious - "&lt;font face="Arial"&gt;&lt;strong&gt;We already have NBuilder and AutoFixture so what on earth do we need another one of these for?&lt;/strong&gt; "&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;When I set out to write AutoPoco, the fact that there were existing projects wasn't even a consideration for me, I wanted a weekend project which combined convention with configuration and exposed a tidy fluent interface in a manner in which I'd like to use it.&lt;/p&gt;
&lt;p&gt;Open sourcing it just made sense because there is no point in keeping things locked away where other people can't see or learn from them (or even give feedback so&lt;strong&gt; &lt;/strong&gt;&lt;em&gt;I&lt;/em&gt; can carry on learning...)&lt;/p&gt;
&lt;p&gt;That aside, it turned out that my desire for convention over configuration, and my overwhelming desire to keep configuration to a minimum whilst generating &lt;strong&gt;meaningful&lt;/strong&gt; test data was a radically different approach (imo) to those existing projects, so I've decided to carry on pushing down that route to see where it takes me.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Could you not have just forked an existing project?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Sure, but then I'd have had even more work to do because the existing projects would have been hard to shoe-horn the convention/configuration aspects into without either wrapping the entire system or re-writing entire aspects of it.&lt;/p&gt;
&lt;p&gt;Approaching a problem in your own way can often lead to alternative solutions and in building alternative solutions and open sourcing them, I see can see no ill effects, only positive ones whereby we all win because we're putting more ideas into the mix.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;But why do what has been done before?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Seriously? This is the kind of mindset that can really irk me at times - without re-takes on existing ideas we wouldn't have any competition, we'd lose a lot of &lt;strong&gt;growth&lt;/strong&gt; in the open source (and closed source) arenas and I dare say we'd all just be working on the frameworks that Microsoft give us because they solve all the problems - right?... right?&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Why write StructureMap if we already have Castle/Unity/etc? (I don't actually know which came first hah) &lt;/li&gt;
    &lt;li&gt;Why do a clone of Hibernate when we already have Entity Framework/Linq2Sql etc? &lt;/li&gt;
    &lt;li&gt;Why create OpenRasta when we have WCF and MS MVC? &lt;/li&gt;
&lt;li&gt;Why create StackOverflow when Experts Exchange already exists? [stretching it a bit here]&lt;/li&gt;
    &lt;li&gt;Etc? &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Because they solve the problems in different ways, because some people don't like the way the existing frameworks work and want something that suits their workflow better, because learning from other people's mistakes means we don't have to carry around the legacy baggage that backwards compatability on some mature software projects can force on us.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Couldn't you have found another problem to solve?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I find this question to be confusing - I spend my working hours and most of my spare time leading the development of a product that is pretty much guaranteed be used by some fairly large PLCs once it has been released, I solve new problems every day and the joy of sitting down with a codebase like AutoPoco is I get to play around with no commercial pressure or expecations and put into practise the things I have learned whilst making something that I consider to be quite &lt;em&gt;pretty&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The enjoyment of such a thing is in writing it and thinking about it - in crafting something I want to use, not in releasing it and not in getting other people to use it (Why I would I even try?) - but to be able to put a small piece of code out and to foster discussion on the pros and cons of the different approaches I have used or could be used with an active and growing community.&lt;/p&gt;
&lt;p&gt;One of the most enjoyable things I ever do in our product is to replace home-grown code with other people's open source efforts so I'm hardly guilty of the crime of &lt;em&gt;doing everything myself - &lt;/em&gt;and we may well end up using one of the existing object generation frameworks rather than AutoPoco if they do more of what we want (unlikely).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Basically...&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you don't like it, then don't use it, and if nobody likes it and nobody uses it then it was still fun to write and nobody lost anything through the actions of a whimsical software developer.&lt;/p&gt;
&lt;p&gt;But... If you do like it, and you do use it, or if other people use it or if other people learn from it, or get ideas from it, or use it as the inspiration for their own take on the problem space then collectively we've all gained something because somebody somewhere is going to be learning something.&lt;/p&gt;
&lt;p&gt;And that is what OSS is about, it's not about getting free software, it's about having the choice to use what you want, and to find out how other people have gone about solving problems and to learn from where other people have tread before.&lt;/p&gt;
&lt;p&gt;Me? I'm enjoying the development of AutoPoco and think there is enough of a difference between it and existing frameworks to justify to myself in the continued development of it. I want my conventions, and I want my automatic set up, and I want to be able to generate a craptastic amount of realistic test data for my systems as well as using it for the day to day unit tests I litter about the place.&lt;/p&gt;
&lt;p&gt;And that's good enough for me.&lt;/p&gt;&lt;img src="http://codeofrob.com/aggbug/19.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rob Ashton</dc:creator>
            <guid>http://codeofrob.com/archive/2010/04/09/why-diversity-and-choice-are-good-things.aspx</guid>
            <pubDate>Fri, 09 Apr 2010 20:37:47 GMT</pubDate>
            <wfw:comment>http://codeofrob.com/comments/19.aspx</wfw:comment>
            <comments>http://codeofrob.com/archive/2010/04/09/why-diversity-and-choice-are-good-things.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://codeofrob.com/comments/commentRss/19.aspx</wfw:commentRss>
            <trackback:ping>http://codeofrob.com/services/trackbacks/19.aspx</trackback:ping>
        </item>
        <item>
            <title>AutoPoco v0.2 Released</title>
            <link>http://codeofrob.com/archive/2010/04/08/autopoco-0.2-released.aspx</link>
            <description>&lt;p&gt;I've added some features to &lt;a href="http://autopoco.codeplex.com"&gt;AutoPoco&lt;/a&gt; to make it actually functional&lt;/p&gt;
&lt;p&gt;Configuration can now be done automatically:&lt;/p&gt;
&lt;pre class="brush: csharp;" title="code"&gt;IGenerationSessionFactory factory = AutoPocoContainer.Configure(x =&amp;gt;
{
    x.Conventions(c =&amp;gt;
    {
        c.UseDefaultConventions();
    });
    x.AddFromAssemblyContainingType&amp;lt;SimpleUser&amp;gt;();
});&lt;/pre&gt;
&lt;p&gt;As to start with, meaningful data isn't always required - just non-nulls and sensible defaults.&lt;/p&gt;
&lt;p&gt;Collections can now be created with controlled content, for example:&lt;/p&gt;
&lt;pre class="brush: csharp;" title="code"&gt;            mSession.List&amp;lt;SimpleUser&amp;gt;()
                .Random(5)
                    .Impose(x =&amp;gt; x.FirstName, "Bob")
                .Next(5)
                    .Impose(x =&amp;gt; x.FirstName, "Alice")
                .All()
                .First(5)
                    .Impose(x =&amp;gt; x.LastName, "Blue")
                .Next(5)
                    .Impose(x =&amp;gt; x.FirstName, "Red")
                .All()
                .Get();&lt;/pre&gt;
&lt;p&gt;Will create a table of data looking something like:&lt;/p&gt;
&lt;table&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;th&gt;# &lt;/th&gt;
            &lt;th&gt;First Name &lt;/th&gt;
            &lt;th&gt;Last Name &lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;0 &lt;/td&gt;
            &lt;td&gt;Bob &lt;/td&gt;
            &lt;td&gt;Blue &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;1 &lt;/td&gt;
            &lt;td&gt;Alice&lt;/td&gt;
            &lt;td&gt;Blue &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;2 &lt;/td&gt;
            &lt;td&gt;Alice&lt;/td&gt;
            &lt;td&gt;Blue &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;3 &lt;/td&gt;
            &lt;td&gt;Bob &lt;/td&gt;
            &lt;td&gt;Blue &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;4 &lt;/td&gt;
            &lt;td&gt;Bob &lt;/td&gt;
            &lt;td&gt;Blue &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;5 &lt;/td&gt;
            &lt;td&gt;Alice &lt;/td&gt;
            &lt;td&gt;Red &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;6 &lt;/td&gt;
            &lt;td&gt;Bob&lt;/td&gt;
            &lt;td&gt;Red &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;7 &lt;/td&gt;
            &lt;td&gt;Alice &lt;/td&gt;
            &lt;td&gt;Red &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;8 &lt;/td&gt;
            &lt;td&gt;Bob&lt;/td&gt;
            &lt;td&gt;Red &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;9 &lt;/td&gt;
            &lt;td&gt;Alice &lt;/td&gt;
            &lt;td&gt;Red &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Obviously these simple examples are only the beginning, I've also written some documentation for the existing features + new features over at the codeplex site:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://autopoco.codeplex.com/wikipage?title=GettingStarted"&gt;Getting Started&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://autopoco.codeplex.com/wikipage?title=Configuration&amp;amp;referringTitle=Documentation"&gt;Configuration&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://autopoco.codeplex.com/wikipage?title=DataSources"&gt;Data sources&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://autopoco.codeplex.com/wikipage?title=Generation"&gt;Object Generation&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I'll be using AutoPoco to generate a ridiculous amount of test data for one of our systems in the coming weeks, so I'll no doubt discover any shortcomings and rectify them, in the mean-time feel free to ask for things in the &lt;a href="http://autopoco.codeplex.com/Thread/List.aspx"&gt;discussons&lt;/a&gt; forum at the Codeplex site (or in the comments here)&lt;/p&gt;&lt;img src="http://codeofrob.com/aggbug/18.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rob Ashton</dc:creator>
            <guid>http://codeofrob.com/archive/2010/04/08/autopoco-0.2-released.aspx</guid>
            <pubDate>Thu, 08 Apr 2010 00:48:41 GMT</pubDate>
            <wfw:comment>http://codeofrob.com/comments/18.aspx</wfw:comment>
            <comments>http://codeofrob.com/archive/2010/04/08/autopoco-0.2-released.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://codeofrob.com/comments/commentRss/18.aspx</wfw:commentRss>
            <trackback:ping>http://codeofrob.com/services/trackbacks/18.aspx</trackback:ping>
        </item>
        <item>
            <title>AutoPoco v0.1 Released</title>
            <link>http://codeofrob.com/archive/2010/04/06/autopoco-v0.1-released.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;** Update: &lt;a href="http://blog.codeofrob.com/archive/2010/04/08/autopoco-0.2-released.aspx"&gt;Version 0.2 Now Released&lt;/a&gt;**&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The product of one weekend and a bank holiday's code, I wanted to simplify the way we were generating test data for our tests, and writing a class called &amp;lt;ObjectName&amp;gt;Builder with lots of permutations for overriding various properties for every single object I wanted to generate was getting tedious.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;I also wanted to have a go at writing something that exposed a fluent interface that could be extended using extension methods, and combined convention with configuration to do its job in an easily configurable fashion.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Combining these two into a project was a fun thing to do, whether the project is of any use to anybody else is irrelevant, but you don't know unless you push these things out...&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;a href="http://autopoco.codeplex.com"&gt;http://autopoco.codeplex.com&lt;/a&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Using it should be self explanatory, but here is a quick overview of what AutoPoco attempts to achieve.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Configuring a factory&lt;/strong&gt;&lt;br /&gt;
A factory can be created once and then re-used by tests (if you so wish), a factory is just a configured instance of AutoPoco and has therefore performed some of the more expensive reflection operations ahead of use.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Using the default conventions, any recognised properties on an object will automatically be populated with an instance of that property type, and this will obviously recurse down the object graph.&lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;
&lt;pre class="brush: csharp;" title="code"&gt;var factory = AutoPocoContainer.Configure(x =&amp;gt;
            {
                x.Conventions(c =&amp;gt;
                {
                    // Map all public properties + fields
                    // Ensure  we don't end up with nulls
                    c.UseDefaultConventions();
                });

                // Include the simple user type
                x.Include&amp;lt;SimpleUser&amp;gt;()
                    // Expicitly set data sources for its properties
                    .Setup(c =&amp;gt; c.EmailAddress).Use&amp;lt;EmailAddressSource&amp;gt;()
                    .Setup(c =&amp;gt; c.FirstName).Use&amp;lt;FirstNameSource&amp;gt;()
                    .Setup(c =&amp;gt; c.LastName).Use&amp;lt;LastNameSource&amp;gt;();

                // Include the user role type (used by User.Role)
                // Set the name as a string with a length between 5 and 10
                // Note: Random is an extension method and only gets provided if the property/field is a string
                x.Include&amp;lt;SimpleUserRole&amp;gt;()
                    .Setup(c =&amp;gt; c.Name).Random(5, 10);

                // Include these types, but use the default conventions to auto-set properties/fields
                x.Include&amp;lt;SimpleFieldClass&amp;gt;();
                x.Include&amp;lt;SimplePropertyClass&amp;gt;();
                x.Include&amp;lt;DefaultPropertyClass&amp;gt;();
                x.Include&amp;lt;DefaultFieldClass&amp;gt;();
            });&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Creating a session&lt;/strong&gt;&lt;br /&gt;
A session should be created once per test (or more), and will use data sources scoped to that session to populate requested objects. An example of this would be a source configured to create unique ids for "database" objects - each id would be unique across that session, but creating another session would mean that session had its own data source back at the original state. &lt;br /&gt;
Don't worry, you don't need to understand this, it's just there for those that want it.&lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;
&lt;pre class="brush: csharp;" title="code"&gt;var session = factory.CreateSession();&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Creating Objects&lt;/strong&gt;&lt;br /&gt;
This is the important bit - any number of objects should capable of being be created from the session, with the ability to easily override any of the properties on those objects&lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;
&lt;pre class="brush: csharp;" title="code"&gt;            // Get a single default user
            // User.Role will be set automatically by AutoPoco
            // User.EmailAddress will be a valid e-mail address
            SimpleUser singleDefaultUser = mSession.With&amp;lt;SimpleUser&amp;gt;().Get();
            
            // Get 100 users
            // They all have different e-mail address
            // They all have different first names
            // They all have different last names
            SimpleUser[] users = mSession.With&amp;lt;SimpleUser&amp;gt;().Get(100);
            
            // Create a role
            SimpleUserRole sharedRole = mSession.With&amp;lt;SimpleUserRole&amp;gt;().Get();
            
            // Impose that role on 100 users
            // Those 100 users still have different e-mail addresses etc etc
            SimpleUser[] usersSharingRole = mSession.With&amp;lt;SimpleUser&amp;gt;()
                .Impose(x =&amp;gt; x.Role, sharedRole)
                .Get(100);&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Arial"&gt;I think this is quite neat and tidy,  although there are lots of features missing (ability to populate collections, a convention to deal with enums, a convention to deal with inheritance - and lots of extension methods to allow the easy manual configuration of all of those things.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;I'll add them as I need them or as they are requested. This is my framework for my use, but you're all welcome to use and contribute to it too.&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;&lt;img src="http://codeofrob.com/aggbug/17.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rob Ashton</dc:creator>
            <guid>http://codeofrob.com/archive/2010/04/06/autopoco-v0.1-released.aspx</guid>
            <pubDate>Tue, 06 Apr 2010 07:54:39 GMT</pubDate>
            <wfw:comment>http://codeofrob.com/comments/17.aspx</wfw:comment>
            <comments>http://codeofrob.com/archive/2010/04/06/autopoco-v0.1-released.aspx#feedback</comments>
            <wfw:commentRss>http://codeofrob.com/comments/commentRss/17.aspx</wfw:commentRss>
            <trackback:ping>http://codeofrob.com/services/trackbacks/17.aspx</trackback:ping>
        </item>
    </channel>
</rss>