Thursday, May 17, 2007

Eating My Own Dogfood

After trumpeting the virtues of making your codebase a single branch, modified by configuration data, I found myself drifting into the maze of twisty if statements, all alike on a recent work project. So I took a deep breath, hitched up my belt, and started all over again.
This time, I'm subclassing from the existing classes for the new message protocol. The project already as the Command pattern in use, so I'm subclassing the command object type, and the processing object type, and instantiating the command objects via a factory, so that the only thing that needs to check if the protocol is in use is the factory, based on the type of the caller.
It's a little more code, but keeping the logic of which protocl is in use tightly controlled will pay off, as this portion of the project is primed for a lot of new development as the current branch of the industry tries to hold off a new branch that has the advantage of decades of advances in telecomm technology.


Technorati Tags --
, , ,
HTTP

No comments: