Thursday, 22 April 2010

Linq-to-sql to use or not to use – my conclusion.

A while back I posted about Linq-to-sql (L2S) and wondering if I should/could use it in a layered fashion and at the time I fully intended to try and come up with a coded solution to show how it could be done.

After much searching I found this article on Code Project showing how to decouple L2S and use unity to build the objects and I thought that I’d use that as a sort of template to see if I could reproduce the functionality myself.

However, after a brief experiment, I gave up on attempting to recreate the code myself, and the reason - its just too much trouble to do so.

As I was trying to create the code I re-examined why I was doing this in the first place and whilst I was looking to be able to use L2S in a layered fashion, I also wanted to do TDD and not need to have to create my own framework to do so.

It was after this bit of introspection I stopped trying to create the code necessary to do this.  The code project article demonstrated how much work would be required to decouple L2S in such a way as to enable me to do what I wanted and although you should be able to wrap all the additional functionality in an assembly you’d need to always use the extra code.

You may think ‘well if its in an external assembly its no bad thing’, but why do this when there are other ORM’s out there that will allow you to easily mock the data context, use POCO classes, TDD, etc?

I was also pointed towards PLINQO by Eric which allows you to provide additional business logic in the partial class for each entity and through its code generation it can do it very quickly, but this doesn’t allow you to mock the DataContext and break the layers apart.  It was because of this that I decided to not pursue PLINQO as a solution to my L2S conundrum.

So after all this what conclusion have I come to? I doubt I’ll be using L2S any time soon for anything other than trivial or prototype applications.

Of course you may have other thoughts and I’d love to hear them.

Monday, 19 April 2010

Presenting at DDD South West

Well I've been lucky enough to be picked to give a presentation at this years DDD South West where I will be presenting a session called 'So you want to try scrum?'

The session will be, unsurprisingly, about scrum; the intention is to cover scrum briefly so that everybody knows what I'm talking about and then spend the majority of the time on 'pain points' that a lot of people experience when trying to implement and work with scrum.

In preparation for this I'm going to try and blog a bit about the pain points to provide some additional material for anybody who comes to watch me.

Thursday, 15 April 2010

Ok, so maybe I didn’t break VS 2010

So following up on my previous post I’ll admit I haven’t actually broken VS2010, but something still isn’t right.

One of my colleagues attempted to convert the project and it worked without any issues, the main difference being he’s running on XP 32 bit and I’m running on Win7 64 bit.

So first up I tried running VS 2010 as admin – but it didn’t seem to make any difference. Then since the build seemed to be stopping at CppCodeProvider and previous items listed in the build mentioned ‘Just my code’ so I googled that and found this forum post so I tried turning off the debugging option for ‘Just my code’ and got further when I ran the code the page displayed but looking at the build output there were loads of errors.

So I tried running VS 2010 as administrator again and voila it all worked.  So I tried turning the ‘Just my code’ debugging back on and ran VS 2010 again as administrator and it still worked.

So now I’m really confused, when I originally ran VS 2010 as administrator it didn’t work, now it does.

I don’t like having to run as administrator so I’m still investigating what the issue is with the project and believe that its related to the fact its a converted project.  What ever I find I’ll blog about.

Tuesday, 13 April 2010

I’ve broken VS2010 already

So today VS 2010 was released (ok if you’re going to be picky it was released yesterday at 7pm BST) and this morning I eagerly downloaded and installed it and then got the rest of my team to do it as well.

I grabbed a .Net 2.0 project and opened it up in the new IDE, completed the conversion wizard which went smoothly and then tried to build the project and it failed. What?! I just built this in VS2005 and had no problems so what’s going on?

Well it turns out that a previous developer had referenced a .Net 3.5 assembly (System.Web.Extensions if you really want to know) and VS 2005 didn’t complain but VS 2010 would not allow that reference since I was targeting the .Net 2.0 framework.

To say I was disappointed was an understatement.

I know what you’re thinking – just change the target framework to .Net 3.5 or even better .Net 4.0 and everything will be fine.  Well I can’t go to .Net 4 since its not rolled out yet and since its been working up to now in .Net 2.0 what I really want is to be able to use the new IDE without a lot of deployment bother.  But in the spirit of ‘this software isn’t going to beat me’ I did try and change the target framework to .Net 3.5 and what happened? Nothing.  By which I mean it didn’t run.  It compiled happily but when you ran it (Asp.Net web forms) the browser appeared but the Application_OnStart was never reached and if I put any break points in the code they came up with ‘will never be hit as symbols have not been loaded’.

So I’ve posted on Stack Overflow and will continue to try and sort it tomorrow, if anybody has any ideas please let me know.