I have installed VS.Net 2005 Pro on a very slow laptop. Why? I need to. Anyway I tried to install sp1 on it recently. My laptop worked for one and a half day and got a heart attack. So I searched for an alternative to install sp1. And I have found it at Heath Stewart’s blog in this article on Slipstreaming Visual Studio 2005 Service Pack 1.

So I slipstreamed VS.Net 2005 and started to reinstall it on my laptop. Everything went well. The .Net 2.0 Framework and the document explorer installed fine but VS.Net 2005 would not reinstall. It complainted about an invalid install package. It turned out that it had to do with the installer cache. You can get more information at Heath Stewart’s blog in this article on Resolving prompts for Source and at Alex Thissen’s blog in his article about Fixing problems with VS.NET 2003, VS2005 and building MSI files. What I had to do was clear the cache. You can do that this way:

For VS.Net 2005 Pro: msiexec /fvomus {437AB8E0-FB69-4222-B280-A64F3DE22591} /l*v vs8_repair.log

For VS.Net 2005 Team System: msiexec /fvomus {1862162E-3BBC-448F-AA63-49F33152D54A} /l*v vs8_repair.log

I hope this will help you solve your problems reinstalling VS.Net 2005

Last saturday was the first dutch code camp. It was fun. I met other geeks like me and there were alot of interesting presentations. There were sessions about WPF, C# 3.0, Linq, XNA, domain driver design and more. Look at the Code-camp site for downloads of the sessions.

A few days ago I needed to retrieve the version information of an Winforms application and append it to some files. I needed to do this via a batch script. I did it with the following script:

@echo off
setlocal
for /F "delims=" %%i in (
'findstr /C:"<Assembly: AssemblyFileVersion" 
".\My App\My Project\AssemblyInfo.vb"'
) do set MyAppVersion=%%i
set MyAppVersion=%MyAppVersion:~32,-4%
pushd .\MyAppSetup\Release\
move /Y setup.exe setup_v%FCVersion%.exe
move /Y MyAppsetup.msi MyAppsetup_v%FCVersion%.msi
popd
endlocal

Nice, isn’t it?

As a software developer it is important to have good people skills. You have to find out what your users want. You have to communicate with them. If you cannot your are at a disadvantage compared to your peers who can. Your current position is determint by your technical skills only for 15 percent, I read somewhere. The other 85 percent are communication skills. Most of the well paid positions are occupied by people with poor technical skills. But they communicate.

As (almost) all geeks I am a bit autistic. Communication is not my strong suite. You have only to ask my wife. I can tell you she wishes I would communicate. As all wifes do I guess. Anyway it is not hopeless. Even if you are not a natural communication talent you can learn it. ‘How?’, you ask. By reading books about communication and start practicing. Learn form those how can. Most communication skills we all have but we do not use them. We do not use them enough. So read and practice.

I recommend the books from Dale Carnegie. They are easy to read and full of practical principals. Some of his books are How to Win Friends and Influence People, How to Stop Worrying and Start Living and How To Develop Self-Confidence and Influence Others Through Public Speaking.

Last weekend I installed Vista. I tried to upgrade my Windows XP installation. It took al long time, I was stupid and impatient. Yes, I pushed the reset button. I thought that my computer was hanging and expected a reset to continue the upgrade where it left off. But it did not.

The only thing to do was to do a clean installation. So I did. Everything went fine. Since ‘My Documents’ does not exist in Vista I copied the contents of ‘My Docments’ in the new documents location. Then I deleted the ‘My Documents’ directory bypassing the recycle bin. I did not make a backup. Another mistake. Why? There are no documents in Vista’s documents location. How is this possible? I lost important stuff. I do not blame Microsoft or Vista, though. I should have made a backup of my important data!

Is it me or is it hard for users to test applications? No, it is not me. Most developers know what I mean. You need to built in some feature. Ok finally it is working the way you want it. That may not be the way your key user wants it to work. So you tell him/her the feature is finished. Go ahead and test it. You go away and your never hear from them again about the feature. Until it becomes a priority for them of course. Suddenly all kinds of action can be detected from your key user. You are told that something is wrong. He or she is disappointed. ‘This must be fixed. I need it yesterday.’ Right! ‘Didn’t I asked you to test?’, you think. ‘Now I have little time to fix it, damn.’ Sounds familiar? And even if users test it is ad hoc, non structured and not repeatable.

Why is that? I think there are three main reasons for this:

  1. Users do not know how to test. They never were explained how to test so it is not easy for them to do structured testing. They don’t know what to do.
  2. It has no priority. Their other work is more important because that’s the stuff their bosses want them to do.
  3. ‘The developer tested it! why should I do it again’. They forget that a developer is not usually an expert in the field of the user.

 

The solution is to educate them and make it a part of their job. The first thing developers can do. The latter could be done by their bosses. Yeah, wishful thinking…

If you have an application that is used by more than one user and it stores its data in a shared database, you have to deal with concurrent actions of your users on the same data. This means for instance that if two users are updating account information for client X at the same time the application must decide which user’s changes should be stored. There are two models for concurrency: optimistic and pessimistic concurrency.

Optimistic concurrency

With optimistic concurrency no locking mechanisms are used. The idea is that the chances are small that users are editing the same data at the same time. So why bother with an resource expensive mechanism like locking? Because it could happen. An application must have some way of detecting this.

ADO.Net helps a developer out by offering support for the optimistic concurrency model. It tracks changes to data it is updating by including the original data in the where clause of the update statement. If the data was not changed one row was updated, contrary to zero rows updated rows. A DBConcurrencyException is throw in the latter case. A simple but elaborate mechanism.

A disadvantage of optimistic concurrency is that the user that first updates the data wins. All other users loose: maybe they had been working for ten minutes on the data and now they cannot save the changes!

Pessimistic concurrency

Pessimistic concurrency works different. It uses locks to make it impossible for users to change other users data. Of course the idea is that the chance that two or more users are updating the same data is small. So the chances are slim also that the lock bothers other users. But locks do affect scalability.

How can an application support pessimistic concurrency? A developer could implement it him-/herself. ADO.Net does help here. That is a difficult job. What about death locks for instance? Luckily databases help us out. Most databases support different kinds of locking and transactions. For pessimistic concurrency to work however the lock must be sustained for the whole period a user is working on the data. So what happens when this user goes for coffee or goes home. Too bad for everybody else? It is a big disadvantage. Isn’t it?

The conclusion

Looking at the the advances and disadvantages of both concurrency models I think is best to use optimistic concurrency as the main mechanism. Pessimistic concurrency should be used when changes to data must be ACID. But both methods can and generally are used by applications at the same time.

 

Today I was surprised to hear that I have co-workers that think that UML has a diagram for a relational database design. I responded by saying that the design of a database is not object oriented but relational and since UML is a modelling language for object orientated systems it would be illogical for UML to have a diagram for relational databases. These concepts are very different. But no I was told. No, no UML has a diagram for relational databases. Tables in a database have methods, select, insert, update, delete and triggers. If I wasn't in a shock I would have laughed. I never heard such nonsense. Humbug as Dickens would say. I tried again to make the point that the relational concept totally differs from the object oriented concept to no avail. One of them said that he was playing with words, that conceptually the database model (the entity-relational diagram) could be represented by UML. OK, and my ass can be conceptually represented by UML as well. Total nonsense. Start reading some books, guys. Start with some basic concepts.

Of course it is possible to model classes in UML that represent tables. This is a common practice. The 'Active Record' design pattern is an example. But this is not a database model and it is not really object oriented. I guess this is what they meant. But then I think they still don't know what they are talking about. They don't know the difference. That is really worry some, I think. If we are talking about a design in the future will we talk about the same things?