Recap: Edmonton Code Camp 2008

edmonton code camp On Saturday we held Edmonton Code Camp 2008 downtown at MacEwan. Code Camp is an all-day event by developers, for developers. The only rule for presentations is that you have to show some code! Otherwise, it’s just a great opportunity to meet other developers in the community, and learn from one another.

We had three tracks of content. For posterity, here’s a list of the presentations we had:

I think my favorite was probably Mark Bennett’s talk on Javascript testing. It was about more than just jQuery, and I learned some really useful things. Like Mark, I’ve been thinking a lot lately about the best way to organize, test, and evolve an application that is Javascript-heavy.

A large group of us went to Metro for lunch, which wasn’t the best idea because we were half an hour late getting started again in the afternoon! It turned out okay though.

Thanks to everyone who came out on Saturday, it was great to meet all of you! In particular, I was surprised at the number of Twitter users in attendance. For a smaller event, there was sure a lot of tweets posted!

Big thanks also to Steven Rockarts, who did most of the heavy lifting to get the event off the ground.

Let’s make next year’s code camp bigger and better!

Technologies I’ve Been Exploring Recently

code Tomorrow is Edmonton Code Camp 2008, so with that in mind I thought I’d mention a few of the developer-focused technologies I’ve been messing around with lately. Nothing too in-depth, but enough to get a feel for things.

MSMQ – Microsoft Message Queuing
This technology has been around since Windows NT 4 and Windows 95, but I’ve never really used it before. I decided to check it out after hearing John Bristowe sing its praises at ALT.NET Calgary. So far I’m really impressed. I still can’t believe I never looked into it before! I was able to get a decent sample going for both reading and writing from the queue (transactional too) in about 40 lines of code.

Ninject
This is a dependency injection framework for .NET applications. Dependency Injection (DI) is a technique that helps you create loosely-coupled, flexible code. I’ve looked at other DI frameworks, but was always turned off by the XML configuration files. In that regard, Ninject is a lot like SubSonic – everything is done in code! It’s pretty easy to get started with Ninject. Reading the User Guide on the wiki definitely helped me.

Json.NET
I’ve been doing a lot of work with the Twitter Search API, which returns data in either ATOM or JSON format. I figured JSON would be better, as it’s a little more lightweight. The .NET Framework doesn’t understand JSON natively, so I looked for a library to help. I can’t say enough good things about Json.NET – it’s fantastic!

jQuery
Okay this doesn’t really belong on this list, because I’ve been using it for a while now. I keep learning new things about it though, such as the data() method that Marc Grabanski wrote about recently. Very cool. I’ve also been enjoying Intellisense support!

There you go, a few of the things I’ve been exploring lately. I’m looking forward to Code Camp tomorrow! If you’re tagging photos, tweets, blog posts, and other things, use the tag #ecc08. Be sure to keep an eye on the wiki. See you there!

SubSonic 2.1

subsonic I’ve been using SubSonic for about a year now, and I’m a big fan. As the website says, SubSonic is a open source toolset for .NET developers that helps a website build itself. Essentially what SubSonic does is automatically generate your data access layer for you. It saves you from having to write the same boilerplate code over and over. Developers like to talk a lot about improving productivity, and SubSonic actually helps in that regard. The latest version, 2.1, was released on Tuesday.

SubSonic is known as an Object-Relational Mapping (OR/M) tool. What that means is that it generates objects that reflect your database structure. So if you have a table called “User” it will create an object called “User”. Unlike most OR/M tools however, SubSonic prefers convention over configuration. This is my favorite part about SubSonic – there are no mapping files! You don’t need to say that “User” is a table you’d like to use, and that the “Username” column is a string. SubSonic figures that out on its own. Everything just happens automagically.

I like to run SubSonic manually on the command line, so that I can stick the code it generates into a class library. You do this by running SubCommander. The objects SubSonic generates by default are Active Record objects. You use them like this:

User user = new User();
user.Username = "mastermaq";
user.Save();

The newest version of SubSonic also supports what’s known as the Repository Pattern, for developers who don’t like the Active Record way of working with objects. You can learn more about that here.

Also new in SubSonic 2.1 are query factories, which let you write fluent code like this:

return new Select()
    .From<User>()
    .Where(User.Columns.Username)
    .IsEqualTo(username)
    .ExecuteSingle<User>();

Doesn’t that look wonderful? It almost makes working with the database enjoyable!

If you are still writing your data access code by hand, I’d definitely suggest taking a look at SubSonic. If you’re using a different OR/M tool, you might want to see how SubSonic compares. It currently works with SQL Server 2000/2005/2008, MySQL, and Oracle.

You can download SubSonic 2.1 from CodePlex. Check out the SubSonic website for more information, and also Rob and Eric‘s blogs.