Nick's .NET Travels

Continually looking for the yellow brick road so I can catch me a wizard....

I'm an Idiot!

Stephen are you happy now?

I'll start by saying that while I might be an idiot I think that Stephen's comment was just childish.  Judging by his resume (which came up with "page not found" the first time I clicked the link .... what server is it running on btw?) I understand that his background is firmly in the Sun camp.  My original comment was actually an attempt at trying to get some educated debate.  In typical Sun, Apple (insert any other Microsoft competitor) fashion his retort is to call me names - great show of maturity.... he wins.

So, I'm going to take the bait and continue the original discussion around the choice of open-source or proprietary technologies affected the ability to create open-source software.  This discussion could be generalised to discuss the pros/cons of these choices in building any software. 

Ok, for the purpose of this discussion lets assume that Java has been open-sourced and that no one company is in control of its future direction.  On the other hand lets use .NET as the proprietary technology which is controlled 100% by Microsoft.  Let's examine some of the risks associated with these technologies. 

In the case of Java we have a technology that is disconnected from any particular operating system.  This means that in every case someone has to put in effort to optimise a JVM for a particular operating system.  This could be done by the OS manufacturer (oh, now hang on Microsoft did that but got slapped with a ruling that now prohibits them from doing it - Sun does know how to shoot itself in the foot ;-). Or it could be done by the Java community.  There might also be multiple JVMs for any one OS by different commercial providers, who then charge for the JVM which brings us back to the original point that Java was supposed to be the open-sourced side of the argument.

On the .NET side of the fence we have a technology that has been heavily invested into by Microsoft.  Now this is not to say that they won't change direction in the future but I would say that it is a fair bet that Microsoft will continue to invest in this technology for many years to come.  They have support for .NET in current and previous versions of their operating system - which clearly they do the work for as it maintains customer loyalty.  Interestingly enough, since the C# spec was put up as a standard, there is an open-source initiative to build a cross-platform runtime, Mono.  My last point on the .NET side is that you can build open-source software on .NET without investing in the Microsoft (or other 3rd party) tools such as Visual Studio .NET.

I'm not sure I've really layout my position here, just added some food for thought.  Again I would be interested in others' thoughts.  And please, if you are going to call me an "idiot", please don't call me a friend in the same sentence!

SQL Server CE Site Update

If you are looking at the Microsoft Sync Services which is likely to be part of Visual Studio Orcas you should check out the MS Sync Services FAQ across at www.sqlserverce.org.  This has been updated to include the information posted by Steve Lasker on his blog. Steve also has a screencast which follows up from my previous post that looks at the sync designer.

Logging options for .NET Compact Framework

Since the first coffee meeting I have been hassling Alan to start blogging.  After migrating the user group's website across to Community Server I was able to set a blog up for him and he just submitted his first post.  One of the pain points for a number of mobile developers is what to use for logging.  Most developers end up doing their own custom solution.  At Intilecta we ripped out most of the useful bits from the Patterns and Practices Enterprise Library.  Based on what Alan has to say in his post I think I would definitely look at log4net as it seems to be quite comprehensive and it runs on the .NET Compact Framework.

SQL Server CE as a testing tool

I noticed that DevPrime has posted an interesting comment about using SQL Server CE (SSCE) is as source database for test data. This was followed up with some comments by Jay Kimble regarding taking a snapshot of a SQL Server database and pushing it into a SSCE database.

From DevPrime's comments it implies that there might be stored procedures in the next iteration of SSCE.  Given what is available in the current March CTP of Orcas I would doubt if this is true.  Given that SSCE is typically used as an in-process database, is there any real benefits to having stored procedures and/or triggers for that matter? 

 

Source control up-time

As I indicated in a previous post we have recently moved away from SourceSafe and started using Subversion.  Since my involvement with the VS2005 betas and using TFS for a couple of small projects I have always been an advocate but there are a couple of things that just don't make it the right decisions for most SMEs.  The first obvious hurdle is the price but I think this is only a minor issue now that Microsoft have a great partner pricing program where you get a TFS license and a number of CALs depending on your partner status (I think it is 10 for certified and 35 for gold partners).

More important than price are the limitations of v1 of TFS.  The two that come to mind are:

  • One of the things that staggered me when I was using it was that there was no built in build scheduling - I would have thought that this would have been a fundamental part of such as system.  The build system should be able to be triggered based on certain events (not just code checkin, perhaps event work item status change?).
  • No support for working offline.  There is support at the project management level as you can export lists to excel, work on them offline and then sync them when you are again connected.  Unfortunately you need to use a power toy to enable offline support for source control.  And even then it isn't true support (as I understand it).  The TFS team really needs to look at how Subversion works - yes that's right Steve (Intilecta's Development Manager) I'm a convert now!

Microsoft, if you really want to work in this space there are some significant issues to be addressed in vNext of TFS to make it a compelling business decision.

(Oh, by the way Grant, Intilecta's SourceSafe (unpatched) repository is just marginally older than your process ;-)

Java is no more open source than .NET

This afternoon I found myself reading an article at The Spot 4 SAP entitled SAP Mobile Engine.  Leaving aside the fact that the article hasn't been written very well at all I want to comment on their continual reference to the Java platform as an "open source technology".  Now the last time I checked Sun still owned the rights to the language and it was their decision as to the changes that are made (please correct me if I'm wrong as I haven't worked in the Java space for quite some time). 

I would like to make the comment that it is possible to write open source software with either Java or .NET and that they choice of technology should in no way affect the identification of the software as open-source.  It really annoys me when journalists just don't get it and claim that just because Java is a "standard" that can be implemented by different vendors it is in any way more open-source than .NET.

Updated: I was pointed to the Open-Source Java Project which is the process by which Sun has announced that it will release its implementation source/details to the community.  At it points out the role of the JCP will not change.  I guess this shows my first point up as being a little inaccurate.  I still hold by my second (and IMHO more important) point which is that you can write open-source software on any technology.  And further I don't believe that by choosing an open-source technology on which your commercial application is necessarily a sound business decision.

Prime position at Barnes and Noble

As I have an extra day here in Seattle following the MVP summit I decided to wander around town and explore the shops.  Of course the first comment is that every second store is a Starbucks, and of those that aren't Starbucks, every third store is a "Seattle's Best Coffee".  The department stores are much bigger than back home and there is both a Borders and a Barnes and Noble within two blocks of where I'm staying.

Since becoming a published author I can't resist the urge to drop into these large bookstores to see if they have my book.  I was pleasantly surprised at Barnes and Noble that they not only had 3 copies of my book, it was also in a prized location on the shelf (I just had to take photos....):

In the past I have only even included the link to Amazon but you can order Professional Visual Studio 2005 online at B&N.

More March Orcas CTP

In my last post I left you hanging to see what would happen when I created a new .sync item from the Add New Item dialog.  So here you go, the following is what the synchronisation configuration screen looks like in the March CTP - bearing in mind it is likely to change, so if you don't like it say so at http://connect.microsoft.com.

For anyone familiar with the MS Sync Services you will immediately see that under Database Connections you can define both a server and a client connection.  This uses the same set of connection strings that are defined within you app.config file for you application.  You can either use an existing connection or create one using the New button.

Under Synchronisation we have the option of specifying how frequently a synchronisation is attempted.  There are a whole bunch of different rules that could be used to define when a synchronisation should be executed so I suspect that this is too simplistic for most developers.  The last option here is the "Synchronize tables in a single transaction" - this can be particularly important where you have relationships between tables (for example orders and order details) and you want to make sure you either get everything or nothing (ie all my order information, or none at all).

Clicking the Advanced + button expands out the dialog to include the following settings:

One of the nice features of the MS Sync Services is its ability to be split so that the client and server logic doesn't all run locally to the application.  This might be across webservices, wcf or the macaroni protocol (basically it doesn't matter how the data gets there so long as it does).  The advanced settings allows us to configure how the designer generates code.  For example you could elect to only generate client, only server or both client and server code.  You might want to split the code across two projects (for example the client code might be in the application assembly, which the server code might be in a supporting webservice project). 

Going back out to the main dialog we can see that there is an Add Item button.  This opens the following dialog which allows us to specify which tables from the server we want to synchronise to the client.

As you can see there is only one table in my database, called Attachments.  The designer uses the Sync Builder to generate the Sync adapters it needs.  As such this dialog is really configuring the Sync Builder so that it can in turn generate the appropriate Sync Adapters.  For more information on how the build works, and as such how these parameters work head across to the MSDN Forum or to www.sqlserverce.org and subscribe to the Sync Services FAQ. 

Finally the March 2007 Orcas CTP

It has taken me a while to get an opportunity to play with the March Orcas CTP but I figured that I could do without a couple more hours of sleep to have a play.  I'm just going to post a few things I noticed - some a small, some a not.... 

First things first - you have to hand it to the product team they really know how to deliver features that are going to make a difference to every developer I know.  Take for example the following screen shot of the right-click shortcut on the solution explorer - notice anything cool?

Yeh, that's right, they have rounded the corners.  This has been extended to the Ctrl-Tab dialog where they have not only rounded the corners, they have also added a preview of the document you are about to navigate to.

 

Ok, so now onto something more interesting.  As most of you will know I have a particular interest in SQL Server Compact Edition (SSCE - www.sqlserverce.org) and the MS Sync Services (aka Occasionally Connected Services, OCS).  Despite only recently releasing v3.1 of SSCE the team has been hard at work and the March CTP already has v3.5 of SSCE.  It also has not only the CTP of MS Sync Services, but also the first cut of the designer dialogs to facilitate working with this framework.

After creating a basic windows forms solution you can go to the Add New Item dialog (the usual way - right-click solution explorer, Add New Item), which looks like...

You will notice that I've highlighted the Local Database Cache option - which generates a .sync file, and the Service-based Database option - which generates a .mdf file (error in the image - should be .mdf).  This is an interesting move for this designer as we can now create SQL Server Database file (.mdf) and a helper class for working with MS Sync Services (.sync).

Unfortunately I will have to leave you hanging on to see what the .sync file is and how the designers look as I really need to get some sleep....

More emulator goodness - Device Emulator v2 ships

One of the significant improvements made in Visual Studio 2005 was in the device emulator technology.  In fact so profound was this change it was badged as Device Emulator v1 - this is mainly because it is the first version that could run as a standalone application without requiring Visual Studio to be installed.  Recently the product team have released version 2 of the Device Emulator which will install over your existing emulator.  Note that if you have downloaded and installed the Windows Mobile 6 SDK you will already have this emulator installed.  More information on the announcement by Anand is available here.

Comparing Object T

Geoff Orr makes a comment about how easy it is to implement IComparable so that items can be sorted in an arraylist.  I would like to extend this by saying that in .NET v2 there is an IComparable(of T) which you should also implement.  Something like this would work:

Public Overloads Function CompareTo(ByVal obj As Object) As Integer Implements IComparable.CompareTo
   If TypeOf obj Is CostCentre Then
     
Return CompareTo(CType(obj, CostCentre))
  
Else
     
Throw New ArgumentException("object is not a CostCentre")
   End If
End Function

Public Overloads Function CompareTo(ByVal costCentre As CostCentre) As Integer Implements IComparable(Of CostCentre).CompareTo
   Return Me.mCostCentreDesc.CompareTo(costCentre.CostCentreDesc)
End Function

I must admit that I'd prefer to use the C# anonymous method to implement sorting on an as needed basis.  For example:

List<CostCentre> lst = new List<CostCentre>();
lst.Sort(
delegate(CostCentre x, CostCentre y)
               {
return x.Description.CompareTo(y.Description);}
           
);

.NET Compact Framework v1 revisited

It's always amazing what you find when you trawl through your unread emails.  Normally I'm pretty good at reading and processing those emails that need immediate attention, which is why this email got passed over until now (only a week or so old).  The innovative team over at Red FIVE Labs have ported a version of the .NET Compact Framework v1 to the Symbian OS.  How cool is that! You can now run your applications, apparently "without change".  Although there are a number of conditions that are layed out in the FAQ - such as in v1 they are really only targeting smartphone style devices and there is no support for SQL Server CE (since this is clearly a native win mobile application)

VistaDB, SQL Server CE I think Not....

In the midst of all the hype surrounding the release of SQL Server 2005 Compact Edition (ok, so maybe I got a little too excited that MS have released the silly no-desktop licensing constraint on SQL Mobile) I must confess that I stopped looking around at alternative lightweight databases for application development.  As part of trying to promote www.sqlserverce.org as a community of interest around SQL Server CE I setup a couple of Google Alerts to monitor posts around the product.  This morning I received a number of email alerts, of which one particularly caught my eye. 

The alert that got me really interested was about a relatively new product called VistaDB.  Now don't be confused by the title as it appears to have nothing to do with Windows Vista (contrary to what the name implies).  According to their product description "VistaDB 3 is the world's first fully managed and typesafe embedded SQL database engine designed specifically for Microsoft .NET Framework, Compact Framework and Mono."

I haven't had an opportunity to download and evaluate this database yet, but if half the functionality is available that they claim in the product comparison with SQL Server 2005 Compact Edition it could well be a good competitor in the space of application databases.  Of course don't forget that data synchronisation is one of the largest problems with building occasionally connected applications and that in order for this database to succeed it needs to support one or more of RDA, Merge and/or MS Sync Services.  The first two are unlikely but I can see that it wouldn't be too hard to build a client sync provider for VistaDB.

Update: I just came across a couple of interesting blogs:

  • The VistaDB product blog, of which the announcement about v3 is here.
  • Ken Cox has dropped his 2 cents worth, plus pointing out that Microsoft MVPs are being offered a free version.

The good and the bad of Qantas

Following Mauricio's post on the good and bad points of travel I thought that I'd add my 2 cents worth with regards to Qantas.  Upon leaving Wellington this afternoon I arrived at the airport to discover that not only did the regular check-in queue have a massive line, the business/Qantas club queue had one too.  Honestly, given I pay a premium for being a Qantas club member I was a bit frustrated that I have to queue!

Thinking that my time was better spent eating and talking to Meg I decided that given I had an hour or so to kill that I would go up to the Qantas club lounge.  Of course this involved being given the 3rd degree at the gates because I hadn't checked in....

Later, upon arriving in Auckland and proceeding to the International terminal I was pleasantly surprised to discover a dedicated business/Qantas club check-in lounge.  There, they not only check you in, they also pre-clear you for immigration.  Going upstairs to immigration and there is a 30 minute queue, luckily pre-clearance means you get to go through the same fast track lane as the airline staff!!!!  Big thumbs up to Auckland airport - it was almost worth the $25 departure tax that they wack you with (why isn't this tax included in the ticket like most other taxes?)

Update: After I made this post I left the Qantas club in Auckland and proceeded to the gate where I discovered a 500m (I kid you not) line for, you guessed it, another security check point.  For all flights going to the US passengers now need to submit to a second security check where laptops have to be removed from bags, you walk through the metal detectors and are then wanded, and basically any fluids are confiscated.  This whole process ended up delaying the flight by 30mins or so. 

On the plus side, upon arriving at LAX and collecting, then rechecking, my baggage I went to the Alaska lounge.  They accepted my Qantas club membership and best of all they have FREE WIRELESS (why this isn't the standard amoungst airport lounges I don't know)

Signing off Version 1

The last three days I have been back in Wellington, NZ, working with the rest of the development team at Intilecta.  We are currently in a transition period between the end of Version 1, which we officially signed off last week, and the commencement of Version 2.  Like most development schedules there are always odd jobs that get postponed.  In our case it is really about maturing our development process and tools.

For version 1 we were using SourceSafe (and praying to the MS gods that it would survive) primarily because the whole team was based in the Wellington office.  Now that the team has spread out physically using SourceSafe has just proven too frustrating due to the way it checks code in/out.  Anyhow the first task in refactoring our development tools has been to ditch SourceSafe and to wheel in Subversion.  I must admit I have been extremely impressed with TortoiseSVN (integration into File Explorer - including Vista) and Ankh (integration into VS2005 - although doesn't use standard API it does a great job).

The next step in the process is to upgrade our build process.  Up until now we have quite successfully been using CruiseControl.NET, although I must admit we have had to put a number of cludges in to get auto product versioning and correct labelling both within SourceSafe and CC.NET.  Again I have been pleasantly surprised with the latest version of cc.net and in particular the way that it integrates with Subversion.  What we want to be able to do is for the daily build we want the revision from Subversion (assigned whenever someone checks code in) to be the final digit in our product assembly version numbers (eg <major>.<minor>.<build>.<subversion revision>).  We also want this version number to be the label that appears in CC.NET.

To achieve the first part we use a command line utility that comes with TortoiseSVN called SubWCRev which allows us to take a template file (eg assemblyinfo.template), replace appropriate keywords (in this case $WCREV$) with subversion information (in this case the latest subversion revision number) and generate a file that can be built as part of the build (in this case assemblyinfo.vb).  All our projects simply reference this file to ensure they all have the same assembly version number.

The second part was a little more tricky, or so we thought.  Initially we thought we would have to do all the processing to retrieve the revision number and to implement a labeller that works with cc.net.  A bit of searching revealed that others had tried to achieve the same result and in fact the latest version appeared to have a new labeller called the lastChangeLabeller.  At least the documentation in the current stable release (v1.2.7) seemed to imply that it was included.  In actual fact it is only included in one of the intermediary builds (we are using 1.3.0.2728).  With this labeller in place cc.net is reporting the version of our product (as defined by the assembly version number).

 I would be interested to hear what others have done in terms of automating the versioning of assemblies as part of the build process.

Sample Images and Icons

Earlier today the team at Intilecta were talking about where to get stock images from.  The obvious candidates being Clipart, online collections, creating them ourselves...  My contribution to the conversation, that I was surprised no one knew about, was the Image Library that ships with Visual Studio 2005.  If you go to C:\Program Files\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary there is a zip file VS2005ImageLibrary.zip which when expanded gives you a selection of sock images and icons of various resolution.  This is a great starting point for simple applications!

Visual Studio 2005 SP1 Update for Vista

Ok, so we have all seen/felt the pain that Vista has caused - none more than in the developer community where we not only have 3rd party applications that don't play nice, our main development environment doesn't even work properly.  I'm sorry but can you, as a fellow developer, honestly say that you feel L.O.V.Ed by microsoft?  Some good news if you aren't, not only is SP2 for SQL Server now available, I noticed that the Update for Visual Studio 2005 is now available here.

Even kids can build Sandcastles

SoftTeq partner, fellow Perth-ITe and co-ordinator of the Perth .NET Community of Practice, Alastair has posted a link to the March 2007 CTP of Sandcastle - a documentation project for .NET similar to what NDoc did.  I posted on this back in August last year where I observed that the process of using the tool was less than obvious. 

I figured since I had so harshly condemed it last time that I'd better go across and take a look.  Well I got as far as reading the instructions for installation (didn't even download it this time).  In the instructions there is a link of to another set of instructions for working with a sample project - this has 12 steps!! I'm sorry but 12 steps to RUN a sample just doesn't cut it.  No thanks, try again Microsoft.