Lock – Modify – Unlock pains
In general, source control has two main models:
The first model is the one that is used in Source Safe and the default for Team System. This is a model I despise. Mainly because it is so limiting.
A couple of examples that I run into recently:
- Can’t refactor, since other files are locked by other users, and I can’t do a solution wide change unless I lock everything else.
- Can’t change the solution, I need to change the configuration for the entire solution, but it is locked by another user, who is currently adding a new project.
- It is possible for a developer to lock other developers.
- I can’t do local changes on my machine without affecting everything else, if only by the fact that I’m locking other developers from using those files.
- Two developers may need to make a fix to the same file, but one is locking the other.
- The idea of disconnected development is strange, and patches are hard to create in this model.
If I ever saw a lock – modify – unlock in a piece of software, I would ask about the problems in concurrency. For some reason, it doesn’t come up when people are using the lock – modify – unlock. This model enforce a lot of communication overhead between developers. “Release this”, “Release that”, “Who has foo”, “Why is bar locked”, etc.
This is even more annoying if you don’t have the permissions to undo a checkout of another user.
To overcome this approach, I become an advocate of partial classes, but this is a bad reason to use them. And then I need to lock the project file itself, which lock other users as well.
The copy – modify – merge model is bliss. I’m using it in teams that are worldwide. No problems whatsoever, even when several developers are actively working on the same part of the project. Conflicts are generally rare, and when they can’t be resolved by the developer committing code, then the developers need to talk. Far less overhead, far less time spent pleasing the source control system.
I know that I talked about this recently, but I had a recent fight with the lock – modify – unlock that caused much grief, and I felt the need to talk about it again.
Comments
Comment preview