Architect or Cobbler?
Good code starts with good design

Grand Prix Gloom

Tuesday, October 18, 2005
Well I'm back home, and the skies are grey and gloomy. The GP weekend in Shanghai was great and it was nice to see Dave and Emma and have some quality meals with them.

I won't say a great deal about the GP itself, it was a great weekend, and the track is brilliant, the view from the grandstand is magnificent, but the race was ruined by a procession of safety cars, so the race itself was a bit of an anti-climax. (Although watching Schumi spin out behind a safety car was almost worth the entrance price :-))

I always like to give out little tips in my blog, so here's my tip from the weekend. Don't add Gin and Tonic to your single malt, it doesn't improve the flavour.

# posted by James @ 8:34 AM   0 comments

Time

Monday, October 10, 2005
This blog business is harder than it first appears, when I started I thought "no bother, it's only a few minutes a day". After some months I'm finding that this is not quite as easy as it sounds trying to snatch a few minutes here and there to write your entries. In any case I am definitely going to be out of action for the next week or so. The wife (who for some reason objects to being called the first wife) and I are off to Shanghai to go and watch the GP (If you don't know what that is, it's a weekend of noise, the odd car flashing past, and the glamorous of the world uniting - not that I count myself glamorous).

Normally being in foreign climes wouldn't leave me incommunicado, but I have been threatened with dire punishments should the laptop make it's way on to the airplane. I have managed to sneak my PDA on, so I may get the sneaky 'blog fix', but I doubt it.

In any case, by this time next week, I may have some pictures on here of a MacLaren winning the race and Ron Dennis holding the constructors cup aloft. Alternatively, there will be some photos of a seriously annoyed 'Geek Boy' bemoaning the 'Papa' team winning the damn thing (marginally better than Ferrari, but only just).

So off to China to tell Dave what to do with his Ferrari shirt.

PS For the benefit of Martin I'm feeling chipper as well :-)

# posted by James @ 9:51 PM   0 comments

Persistence

Wednesday, October 05, 2005
I spend a fair bit of time on the ASP.NET forums and a common theme that recurs is developers wanting to know the best practices for persisting their object state to a database. Now clearly you could just use the ADO.NET dataset from your business objects, but conventional wisdom tells us that your business objects should be decoupled from the persistence layer. This gives several benefits:
  • Your business layer and database are decoupled
  • All the data access code is in one location
  • Developers can focus on business logic development without having to worry about schemas, databases etc.

Of course it's not all sunshine and light, and there are some disadvantages as well:

  • Your DBA is not going to be as happy with dynamically generated SQL, they feel it is inherently less secure and more difficult to tune.
  • You need to build a mapping between the business model and the database.

This mapping layer is usually called a Data Access Layer (DAL), and can be created by the development team, usually using patterns such as Data Transfer Object, Data Access Object etc.

It should come as no surprise that there are several frameworks which gan generate these DALs dynamically, and these tools are commonly referred to as Object Relational Mappers (ORM), and these are starting to appear in the .NET world. You can get mappings of popular Java tools like Hibernate which are being ported, but there are also tools which have appeared in .NET with no Java legacy.

Over the next few days I'll look at the patterns that you need to understand, show you how to build your own DAL, and finally show how an ORM can do much of this on your behalf.

But for now, I'm going to my bed. I've just landed from New York and the jetlag has started to kick in, not even an Espresso can keep me awake now.


# posted by James @ 9:47 AM   0 comments
This page is powered by Blogger. Isn't yours?