Which SubSonic 3 template to use

subsonicsubsonic3

EDIT: There's now a doc page on this so this question is irrelevant, also it's outdated. Read the docs not this question.

I've been toying with the SubSonic 3 code generation for a month or so now and I'm interested in getting some feedback from others on which template they use and why.

EDIT: Rob's been blogging about the different templates so I've added links to the posts

ActiveRecord – More details from Rob's blog

Pros

  • Supports a popular and well understood pattern
  • Allows easy migration from version 2.2
  • Built-in testing for ActiveRecord (See Rob's answer below)
  • Implements the Repository pattern

Cons

  • Considered heavyweight in the objects it generates

Simple – More details from Rob's blog

Pros

  • Generates POCOS
  • Implements the Repository pattern

Cons

  • Generates a massive single file for all classes that can make browsing the generated source a pain

Advanced

Pros

  • Generated file structure is much neater than simple
  • Generates POCOS
  • Implements the Repository pattern

Cons

  • ?

Best Answer

Everything uses the Repo - it's at the core of all the templates and is now in SubSonic's core code. I can't help you in choosing, necessarily, but what I can say is that ActiveRecord will allow you the most options.

One thing I haven't shared with people (that I will soon) is the built-in testing for ActiveRecord. In your test project, just use "Test" as your connection string and the AR template will not hit your DB. Moreover you can use the static "Setup" method to pump test records into the in-memory list.

Adds/Updates/Deletes all work agains the in-memory stuff.

In terms of "Heavy" - I like to think "Easy" trumps. And it doesn't get any easier than ActiveRecord.