April 2010 Entries

A gotcha for those Fluent interfaces

Here is an interesting one that I posted up on Pastebin a few days ago, but has come as a surprise to anybody I've pointed it out to. When building strongly typed fluent interfaces for any purpose, it has become increasingly common to abuse expressions in order to retrieve members with a utility like so: myFunkyInterface.GetProperty(x=>x.SomeProperty); This can then be used in place of magic strings and name changes can then be caught by compile time errors instead of test-time exceptions. The lambda based GetProperty method will typically look something like this: MemberInfo GetProperty<Tpoco, TReturn>(Expression<Func<TPoco, TReturn>> expression) { ...

AutoPoco 0.4 released - features features features

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 :) What have I added? Glad you asked: Method Invocation 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. It's all been done in a strongly-typed manner to fit in with the rest of AutoPoco. x.Include<SimpleMethodClass>() ...

Why diversity and choice are good things

I noticed a bit of traffic coming from somewhere I didn't recognise, so I went over to check it out... It was just ranty link bait so I won't bother linking it, 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... Starting with the obvious - "We already have NBuilder and AutoFixture so what on earth do we need another one of these for? " When I set out to write AutoPoco, the fact that there were existing projects wasn't even a consideration for...

AutoPoco v0.2 Released

I've added some features to AutoPoco to make it actually functional Configuration can now be done automatically: IGenerationSessionFactory factory = AutoPocoContainer.Configure(x => { x.Conventions(c => { c.UseDefaultConventions(); }); x.AddFromAssemblyContainingType<SimpleUser>(); }); As to start with, meaningful data isn't always required - just non-nulls and sensible defaults. Collections can now be created with controlled content, for example: mSession.List<SimpleUser>() .Random(5) ...

AutoPoco v0.1 Released

** Update: Version 0.2 Now Released** 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 <ObjectName>Builder with lots of permutations for overriding various properties for every single object I wanted to generate was getting tedious. 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. Combining these two into a project was a fun thing to do,...

Multi-tenancy in ASP.NET MVC - Controller Actions (Part II)

(Or a post-mortem examination of what MvcEx taught me about MVC frameworks) Previous entries in the series Why we want it Breaking it down + Themes Views Controller Actions (Part I) A long time overdue (our multi-tenant product is nearly ready for release woohoo!) - I'm going to write a bit more about compositing controllers from "action containers" - which is how my reference multi-tenancy framework (MvcEx) currently does things. I want to explain my motivation for attempting that solution and to give a few opinions...

Copyright © Rob Ashton

Design by Rob Ashton, Based On A Design By Bartosz Brzezinski