Posts

I don't like AccuRev

A company I have been contracting for decided to use AccuRev as its source control solution. I've not liked it from the start because it is too much work, the terminology in it is quite frankly stupid, and it is far too "chatty" when you work remotely.  Anyway, for some time now I have suspected it has been losing source code. On a few occasions I have found myself looking at source code and thinking "I could swear I have already done this!". Well, last week I wrote some pretty nice code which used multiple threads in a test case to ensure I experienced expected behavior when multiple users update the same objects in a database.  Today one of the other programmers said to me "Didn't you write more tests than this?" and showed me the tests.  My multi-threaded tests were gone! I knew it all along, but now it is indesputible, AccuRev has been losing my work!

The Pragmatic Programmer

My copy of this book has just turned up. I am book hungry these days, can't wait to read it :-)

Connascence

I’ve just finished reading What every programmer should know about object oriented design . The first couple of sections are a bit useless really, but the 3rd section is very good. I particularly liked the section on the difference types of connascence in software. There’s some basic information about it here if you fancy a brief overview of what it is about. It’s a really good book, I recommend you read it! Should only take a day if you only read the 3rd section.

I've just ordered a Java book

Image
http://java.sun.com/blueprints/corej2eepatterns/index.html It was only $0.41 used in the USA, came to about £6 with posting to the UK. I don't write Java and at the moment have no interest in learning it, but I expect I will be able to read it without problems (never really looked at it). So why did I buy this book? Because it is about this... That's why :-)

Prism - Invariants, and pre/post conditions - update

Just found out that I can do this too public invariants   Overdraft >= 0 : ’OverdraftGreaterThanOrEqualToZero’;   Balance + Overdraft >= 0 : ’BalancePlusOverDraftGreaterThanOrEqualToZero’; end; Then in my handler routine I get that message! if not IsValid then   throw new Exception(ErrorMessage); Excellent :-)

Prism - Invariants, and pre/post conditions

I’ve been looking at Prism some more recently. I’m a bit annoyed with myself really because someone has been telling me to look at it for years but I wanted to concentrate on C#. Now that I am looking at it I see things in there which I really like. Recently I am looking at invariants, pre-conditions, and post-conditions. First let me show you the invariant support. An invariant is like a class constraint, it specifies a condition which must be true but when must it be true? type   BankAccount = public class   public     property Balance : Decimal read write;   public invariants     Balance >= 0;   end; The invariant is enforced each time a public method exits. Actually it is enforced after the post-conditions of a public method exits but we don’t have any post conditions yet. class method ConsoleApp.Main; begin   var account : BankAccount := new BankAccount();   //The next line throws an assertion error   account.Balance := -1; end; Property getters and setters are considered

Injecting into the ECO cache

In my previous post I showed an interface ILockable. The actual interface is public interface ILockable {   Guid GetLockID();   Type GetLockObjectType(); } Any lockable resource implements this interface. In its constructor it creates an instance of a class which descends from LockObject, a Document class for example would create an instance of DocumentLockObject which descends from LockObject. The "Document" class would store away the ID of the DocumentLockObject in a private attribute. Now when my LockingService is asked to lock multiple (un-related) instances which implement ILockable I want to do this 1: Create a new EcoSpace 2: Load objects efficiently 3: Get locks 4: Update the DB 5: Dispose of the EcoSpace If I experience an OptimisticLockingException then loop and try again. The item I would like to discuss is #2, "Load objects efficiently". In my model a LockObject has a *--1 association to Session identifying which session has locked it, I want to en