Saturday, 25 February 2012

GiveCamp project continuing...

So I'm having a cheap Friday night by staying in and doing some more coding on the project that was started at #GiveCampUK back in October. We've pretty much decided on the database schema now which has meant that I can spend time setting up the entities and support libraries for the application.

Originally, this was going to be an application written using Microsoft Lightswitch, a simple query screen development platform sitting on top of Entity Framework 4. However this was canned due to limitations in Lightswitch preventing us writing queries that would perform well. It's a nice idea and environment (once you've got your head around it), but it's profoundly limiting with respect to what it allows you to do with the queries it generates. So, as I said this was canned after it became clear that it wasn't going to play nicely.

Therefore, I find myself writing a .Net WinForms application. But I've hit a problem which may see this just go back to being a website.

I've put a lot of effort into the model and store patterns used, into the caching that will be available to the application, into the Spring.Net implementation which keeps the whole thing easy to configure, into the stored procedures performing basic data access to the entity tables; but it's no good:

The problem is that this will be used by more than one person, at the same time.

Therefore, if something changes in the database, every connected application must be kept up to date.

This causes me a massive, massive problem for consistency. But I don't know if I am worrying about this unduly? After all, the people using this aren't going to be doing break-neck speed data entry, they aren't going to be removing large swathes of the database, they're probably going to be doing one thing each, and they're probably going to be in the same room. So, how much do I worry about it?

What I have currently is a watchdog system. A scheduled background task in the application calls 'home' to the database to determine if there has been a change since the last time it checked / a change occurred. This notifies the master cache that it should reload its data again. The application needs to make sure that this behaviour does not interfere with what the user is doing too much, and I don't know at this point whether it will do that.

I'm going to try and press in with this as a simple WinForms application, but it is very tempting to just make it an ASP.Net website which means that all the locking can be performed locally and safely.

Maybe I should've gone to the pub after all...

No comments:

Post a comment