Handy Rhino.Mocks Tip

Tom Opgenorth
I just pulled this handy tip from the Rhino.Mocks mailing list: If you would like to see more details of the expectations that you are recording and matching, try adding this in your test setup: RhinoMocks.Logger = New TextWriterExpectationLogger (Console.Out) You should then see all the logging messages in the Output window of Visual Studio.

Trying to Mock the Unmockable

Tom Opgenorth
(or, DataRowView How I Hate Thee) Recently I had to enhance an ASP.NET 2.0 GridView on a Web Form.  Basically, the idea is that, if a certain field in the grid was false, I would strike-through all the text in that row.  It seems simple enough: just use the RowDataBound event of the GridView control and  apply the formating.  Wanting to make this as testable as possible, I thought that perhaps some sort of decorator class would do the trick, something like: myGridView.

Not So Deep Thoughts on Stored Procedures

Tom Opgenorth
Lately I've come to the conclusion that stored procedures are more of a specialist's tool than a generalist.  To me, stored procedures are the kind of thing you use when you need to optimize your data access, or you have to do something DB specific.  Sure, I've seen lots (and written lots) of stored procedures to do the basic CRUD (mostly in SQL Server, but also in PostgreSQL). These days though, I almost think that one doesn't need stored procedures for the basic CRUD, only for specific and special cases.

NHibernate Best Practices

Tom Opgenorth
Well, I see that Billy McCafferty has updated his article NHibernate Best Practices with ASP.NET to cover NHibernate 1.2.  Excellent article, I'd suggest taking the time to read it.

Embedded Database and .NET

Tom Opgenorth
As mentioned in some of my previous blog entries, I'm looking for am embedded database.  At the present, I think that I will remove SQL Server CE for now.  The biggest reason is that, as part of my pet project, the application to run on Mono as well.  So, that kind of leaves SQLite and Firebird.  Now, in theory, it should matter much between the two for what I want to do.

Active Record Entry #1.5/Genom-e Express

Tom Opgenorth
Well, as predicted something did distract me from my ActiveRecord experiment.  I got a copy of Genome Express while at an EDMUG meeting recently.  Given that my copy of Genome Express was shiny and new, I installed it and began playing. My initialize impression is that it's promising.  I was able to very quickly reverse engineer a SQL 2005 schema and get a heirarchical data model going.  I was able to generate working DAL code for a 12 table database inside of a couple of hours.

Active Record Entry #1

Tom Opgenorth
Well, after playing with ActiveRecord for about a week and a bit now, and I can say it's kind of a love-hate relationship.  I like how easy it is to drop in a class, or to make changes to the DB schema and have that reflected in your model.  Contrawise, changing databases should be just as easy. Troubleshooting is a real bitch, and I find the documenatation a bit on the light side.

A First Impression of MSBuild

Tom Opgenorth
Lately I've been playing with MSBuild, the new build tool that ships with Visual Studio 2005.  Before, I've always used Nant for my automated builds.  I've been using nant since 2002 or so, and found it to be a pretty useful, stable tool to take the drudgery out of deploying builds.  Figured I would give MSBuild a try, just for comparison sake.  I must say, MSBuild isn't bad.  One thing that I've found interesting about is that it has been ridiculously easy to port tasks from nant and nantcontrib to MSBuild.