Posts tagged with subsonic - page 2

My 2006 development tools

Christopher Bennage wrote about his development tool set-up and encouraged others to do the same so here’s my current set-up.

Daily tools

  • Visual Studio 2005 – IDE of preference despite it’s sluggish behavior
  • SQL Server 2005 Management Studio – Took getting used to but it’s an improvement on 2000’s Enterprise Manager
  • AnkhSVN – Subversion support inside Visual Studio 2005
  • .NET Reflector – Searching .NET API or to find out what it’s doing
  • Web Application Projects – Stop using VS’s web sites and start using web applications!
  • Web Deployment Projects – Deploy to dev, test or live servers as easily as building a project

Not quite daily

  • CodeSmith – Need to get to grips with v4 to build our whole database layer in one hit
  • Trac – Bug tracking, milestones & wiki with integrated support for Subversion
  • TortoiseSVN – Check-in/out of non-project items (e.g. art assets)
  • Web Developer Extension – Trying CSS changes on-the-fly, validating pages etc. from Firefox
  • Firebug – Examining pages, the page DOM etc. from Firefox
  • KDiff – Excellent 3-way diff tool that works great with AnkhSVN
  • Subtext – Blogging system running here

On occasion

  • Visual C# Express and XNA – Messing with 3D graphics, controllers and pixel shaders
  • Ogre – Steve’s object-oriented 3D engine
  • Xcode and Cocoa – Still quite alien with it’s message-based calling mechanism but obviously powerful

Keeping an eye on

  • Eclipse – IDE for developing Java (C++ and C# support in various stages too)
  • Ruby on Rails – Interesting RAD approach to web development – Apple also supporting on Mac OS X 10.5
  • Sandcastle – Microsoft’s documentation tool that already seems to have had an impact on NDoc
  • SubSonic – Build-provider that generates an ORM on the fly and provides automatic developer-only db editing pages

Not used lately, still installed

  • Delphi 5/6 – Borland’s great RAD tool for non-.NET development, later versions support .NET too
  • JBuilder – Java development although I’d probably move to Eclipse
  • Visual Studio 2003 – Still required for the odd .NET 1.1 application/testing

[)amien

App-A-Day & SubSonic

Screenshot of WPM Tray in action

App-A-Day

Self-proclaimed Code Jedi Dana Hanna is on a mission to destroy his personal life by writing an application every day for 30 days.

There are a few great apps in there and all come with source – the ones I checked out were in C# :)

Some of my favorites are:

  • WPM Tray – display you word per minute count graph. Also a demonstration of how to hook global key-presses in C#
  • Jedi IRC – a small IRC application as a Visual Studio plug-in – both interesting things to see done in C#
  • Mouse Heat Map – get a display of where your mouse lives on your desktop! :D

I must confess these tiny fun apps have inspired a couple of my own that I’ll hopefully knock up and post at some point.

SubSonic – The Zero Code DAL

In other news SubSonic has come on a lot having addressed all the major issues apart from still being ActiveRecord based over DataMapper pattern. (If you haven’t seen it before check out the 20 minute screen-cast)

Rob, the brains behind SubSonic, has been interviewed over at the DotNetRocks podcast and I recommend giving this one a go – don’t let the first 5-10 minutes of warm-up and ads put you off.

He’s also put together a starter site solution you can pick-up from the same place which has some useful bits.

[)amien

Choose your ORM: Runtime, code generation or build provider?

Selecting the right object-relational mapper is a tricky decision with many factors to weigh up.

One of the basic decisions is whether to go with a dynamic run-time (“black-box”) or a code generator.

I’m not a fan of the run-time approach – the discovery at run-time negatively impacts performance as it often uses reflection (or failing that post-compilation byte code modification) whilst robbing you of compile-time checking, IntelliSense support against your database objects, deployment and potentially licensing issues. In effect, it’s not that much better than a typed dataset.

Code generation provides for a much finer granularity letting you tweak the templates for the performance and features you need whilst also providing full compile-time checking and IntelliSense support.

Tools such as CodeSmith (my personal favorite), MyGeneration (free) do a good job of letting you write these templates and create the necessary ORM code but require being re-run every time you change the schema. During the starting phases of a project this could be quite often and goes against the whole concept of RAD.

So step in SubSonic and it’s build provider approach.

The idea here is that you modify your .config file to include the SubSonic build provider and it’s connection string, drop a simple text file in that lists which tables to work with and you’re done.

SubSonic now goes off to your database via the connection and generates all the code for tables you need and it’s magically there to be used like any other classes. Check out the demo to see just how easy it is.

SubSonic supports a large number of databases, has support for Enterprise Library, is open source and also provides simple “scaffold” pages that let you throw a basic web add/edit/update/delete table maintenance page by just throwing a table name attribute onto an empty page’s form element.

The only downside at this point is that it uses the ActiveRecord pattern for the ORM. If I manage to get some time to spend with it and can knock up a Domain Object + Data Mapper version I’ll let you know.

[)amien