September 2007 - Posts

SRT's ActiveRecord Coding Sprint (and a "gotcha" to watch out for)

After our open house, a few of SRT's consultants stayed to have a little Coding Sprint with Castle -- specifically, ActiveRecord.

Darrell Hawley, Jay Wren, Rocky Krcatovich and I started with the typical, employee database design: A company, which has many departments and many employees.  Each employee exists in a department.  Pretty simple.  Darrell and Jay have used Castle before.  I just played around with it a little this weekend in preparation for this Coding Sprint.  Darrell and I did a little pair programming -- I watched him set up the database, the Company class and unit tests for creating a new company.  Later, I did the Department and Employee classes along with their unit tests which he watched.

Darrell began by creating a SQL Server database.  Jay decided to go the open-source route and use SQLite.  He was hoping that SQLite's in-memory database option would speed up his unit tests, but I don't think he ever got that far.  Darrell finished his Company set up (table, class and unit tests) before Jay had his database set up.  :)

When it came to my turn, I typed out the Department class pretty quickly, but when it came to my unit tests, I kept getting an error from ActiveRecord that I hadn't initialized my Department type.  We looked over the code for close to an hour and could not figure out what we did wrong.  Here's a super-simple recreation that will show you the error:

using System;
using System.Collections.Generic;
using Castle.ActiveRecord.Framework.Config;
using Castle.ActiveRecord;

namespace ARoops
{
    public class MainApp
    {
        static void Main()
        {
            XmlConfigurationSource source = new XmlConfigurationSource("appconfig.xml");
            ActiveRecordStarter.Initialize(source, typeof(Department));

            Department dept = new Department();
            dept.Name = "Accounting";
            dept.Create();
        }
    }

    public class Department : ActiveRecordBase<Department>
    {
        private int _id;
        private string _name;

        [PrimaryKey]
        public int DeptID
        {
            get { return _id; }
            set { _id = value; }
        }

        [Property]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
    }
}

If you create this ActiveRecord project and run it, you'll get the following error:

You have accessed an ActiveRecord class that wasn't properly initialized. The only explanation is that the call to ActiveRecordStarter.Initialize() didn't include Department class

I'm sure many of you who are familiar with ActiveRecord will spot the error right away.  When Darrell finally found it, we were both pretty disappointed that Castle didn't catch this right away.  And it was such a simple little error.

What did we forget?  We didn't decorate the Department class with the ActiveRecord attribute:

    [ActiveRecord]
    public class Department : ActiveRecordBase<Department>
    {

Once we did that, everything worked fine.  I wonder why the ActiveRecordStart.Initialize() method doesn't check to make sure the types passed to it are decorated with the ActiveRecord attribute?

Posted by psteele with no comments

SRT Open House

We had our open house last night to show off our new office space to friends, clients, co-workers and family.  Lots of people showed up, even our 36-weeks pregnant Microsoft DE Jenifer Marsman -- what a trooper!  A fun time was had by all and the food was just about all gone in the end.  Here's a few pictures:

srt-open-house-01  srt-open-house-02  srt-open-house-03

srt-open-house-04  srt-open-house-05  srt-open-house-06

srt-open-house-07  srt-open-house-08  srt-open-house-09

srt-open-house-10

Posted by psteele with no comments

Halo 3 Pre-Launch Party

I attended the Halo 3 Pre-Launch Party on Monday.  It was fun a lot of fun.  XBox 360's set up all over the place with Halo 3, PGR 3 and Forza Motorsports 2 -- and lots of good food and company!  I signed up for the tournament even though I'm not that good.  About 95% of my FPS experience has been on a PC, with a mouse and keyboard (DOOM, Quake, Half-Life, etc...).  My brother-in-law got me Halo 2 for the XBOX for Xmas a couple of years ago.  I played it a little bit, but I just couldn't transition from the fluidity of a mouse to the "stiffness" of a joystick.

So when tournament time came around, it was pretty messy.  The early rounds were 10-minute, 8-player deathmatch events.  I got one kill in the first 30 seconds or so.  That was it.  The next 9:30 minutes was me running around, tossing a few grenades (with little effect) and getting killed.  At least I got my one kill against all those kids.  And thankfully, I wasn't in last place...

Posted by psteele with 1 comment(s)

Halo 3 Pre-Launch Party @ Microsoft!

Thanks to Microsoft for the invite to the Halo 3 Pre-Launch event.  Everyone is talking about this.  I get the opportunity to play a little Halo 3 while other people are sitting in long lines waiting for the clock to turn to 12:01am!  Too cool.  I spent a few minutes and created a little "I'll be there" tag.  Feel free to copy/swipe/modify/abuse as you see fit!

halo3_prelaunch

Posted by psteele with no comments

A Good Time At GANG!

Last night was our monthly GANG meeting and we had local DE Jennifer Marsman giving a talk on Windows Workflow (WF).  It was a great talked and we had really good turnout.  Here's some pictures!

Jennifer talks to a busy room:

gang_sep07-1

Jennifer likes to talk with her hands:

gang_sep07-2  gang_sep07-3  gang_sep07-4  gang_sep07-5

Our President, John Hopkins, chats with a user after our meeting:

gang_sep07-6

Don't miss next month's meeting.  We'll have Microsoft Consulting Services Architect Tim Landgrave leading us through a tour of the Microsoft development technologies available today, tomorrow and into the foreseeable future.

Posted by psteele with no comments

Where are things heading?

Since I've got about zero hours of experience using AJAX and haven't done a "serious" ASP.NET app in over a year, I found Joel Sposky's latest post pretty interesting.  It'll be fun to see how all of this stuff plays out...

Posted by psteele with no comments

More Windows Workflow (WF) Goodness!

Local Developer Evangelist Jennifer Marsman will be presenting at GANG tomorrow on Windows Workflow.  Here's the abstract:

Windows Workflow Foundation (WF) is a programming model, engine, and tools for quickly building workflow-enabled applications. Released as part of the .NET Framework 3.0, WF radically enhances a developer’s ability to model and support business processes. In this talk, we will discuss why the Windows Workflow Foundation was created, how to use it, and code some examples to get you familiar with the core classes.

As always, we'll be at Microsoft's Southfield office, we'll have free pizza and there will be prizes given away.  Don't miss it!

Posted by psteele with no comments

Mike Wood's WF Presentation

I was at SRT's offices for their first "major" (as in more than 5 attendees) hosted event last Wednesday.  The Ann Arbor .NET Developers Group had Mike Wood in town to give a talk on Windows Workflow (WF).  The presentation was awesome and opened up my eyes to WF.  I saw an immediate benefit to some work I'm doing at a current client.  But, alas, it is not meant to be.  This client still runs Windows 2000 on the majority of their machines so .NET 3.x is out of the question (for now).

Here's a few shots of the presentation:

woodwf-1 woodwf-2 woodwf-3

Posted by psteele with no comments

SRT's New Offices

Bill Wagner talks about why we finally got some office space.  I've got some pictures here that I took when I visited our new offices for last weeks AADND meeting.  The office space is really nice and I wished I lived closer so I could visit more often.  It just doesn't make sense to commute for 70 - 80 minutes (one way).  That's a lot of billable time lost!  However, I plan on being there from time to time for special events and other things that SRT will be hosting.

Now, on to the pictures.  Please excuse the lighting.  My "real" flash is in for service so I only had the camera's built-in "pop up" flash.  Those don't have a very good distance and you can't bounce them off anything so they give some harsh shadows -- so I didn't use it!

Here's looking down the office from the main door:

newoffices-1

Here's our conference room.

newoffices-2

From the other side of the conference room:

newoffices-3

Our little kitchen nook:

newoffices-4

Bill and Dianne's office:

newoffices-5

Getting ready for a user group meeting:

newoffices-6

What the speaker will see (minus the people!):

newoffices-7

Posted by psteele with 3 comment(s)

The Beauty Is In The Simplicity

This is so simple, it's beautiful.  A very elegant way of dealing with Enums.

Posted by psteele with no comments

Change Is Constant

I thought that once school started, I'd be able to get caught up on blogging since the kids would be at school most of the day.  But since then, work has gotten busier and my evenings are packed with after-school activities and sports...

I've meant to post this for over two weeks now but have been so busy I haven't had the chance.  After almost 18 months of being an independent consultant, I'm moving on.  Well, sort of.  I'm still a consultant, but I'm no longer independent.  Ann Arbor-based SRT Solutions made me an employment offer and I accepted as of September 1st.  I'm still doing the same work I did before (and I'm even with the same client), but I'm now an employee of SRT.

The decision was pretty easy.  SRT is run by Java guru Dianne Marsh and Microsoft RD and MVP (and noted C# author!) Bill Wagner.  SRT doesn't just deliver outstanding results, we help train the on-staff developers we work next to so when we leave, those developers have new skills, knowledge and expertise (shameless plug!).

It's very exciting to be a part of a company again.  I've got a blog over at SRT, but I'll be cross-posting between here and there for the time being ("here" being weblogs.aspnet and "there" being my SRT blog).

Posted by psteele with no comments