Archive for April, 2008

What about deployment?

Friday, April 25th, 2008

I’ve recently been subcontracted to write an application for a clients’ client. I have to deliver the application in a easy to install fashion, since I won’t be installing the application myself.

The problem with software deployment is that it is almost always an afterthought, so much time and effort goes into developing this great software, but hardly any time goes into planning and building an effective deployment strategy. When finally delivering the product to the client and deployment goes awry, the client starts developing second thoughts about the quality of your product.

This got me spending some time considering my deployment options in a more thorough way. Usually when I deploy an application I go to the client and install it for them, trouble shoot any installation issues and when there is a new release I either log in remotely, upload the new assemblies and update the database manually(using scripts) and everything is up to date.

In this scenario things will be a bit different as I won’t have remote access to the client machines and visiting on-site will probably not be an option. Thus I have opted to use ClickOnce deployment, with the deployment folder on a web site. This is great for dll’s and exe’s but what about database changes?

Since we have to assume that the person using the application won’t be tech-savvy enough to manually run scripts on the database(using SQL Management Studio Express, with SQL Express 2005), I have to think of a smarter way to deploy scripts on the remote database. So, I’ve come up with a solution:

In the application, there will be a button "Check for update" this button will first connect to the same ClickOnce server and download a zip file in the format _Scripts.zip i.e. CALC1.0.1_Scripts.zip. In this zip file is all the scripts required to update the database to the latest release. After the zip file is downloaded, the scripts will be extracted and run. After this is complete the normal ClickOnce update will happen. Perhaps not the most elegant approach but effective in the tests I’ve run so far.

The missing LINQ

Monday, April 14th, 2008

I’ve been playing around with LINQ, in order to start moving toward CSLA version 3.5, which makes extensive use of LINQ.

So far, it’s been a fairly pleasant trip. The OR-Mapper included in VS 2008 links (linqs?) your object nicely together and it’s pretty straight forward to get started. Here’s a quick rundown of how to use it:

First download the Northwind Sample db here. Start a new Windows Application project and add a new connection to the db using the server explorer.

Next, add a new LINQ to SQL classes item to your project and call it Northwind.dbml. Drag the Customer table onto the designer, followed by the Orders table. Tada! It automatically adds an association, based on the relationships in your database, between the Customer and Orders tables/objects.

Everything happens behind the scenes, so if you right-click on the customer object and select View Code, it’ll take you to a partial class of Customer. In here you can add some custom properties and methods. All the CRUD operations are handled for you.

It’s all a still a bit "Black Box" for me, but the concept is excellent! If you start looking at Rocky’s implementation of it in CSLA 3.5, you’ll realize it’s pretty cool stuff.

I’ll post a couple of tutorials in the coming weeks about CSLA 3.5 as I figure stuff out. Check back soon!


Google Analytics integration offered by Wordpress Google Analytics Plugin