—A look at how to deliver reliable software.
I was looking for a simple, pragmatic example on how to inject logging into an application and came across this solution. Game Programming Patterns provides a collection of design patterns for, well, game programming. I’m not a game programmer, but I found the writing style engaging and the the information pragmatic.
On the writting style:
But the architecture this brilliant code hung from was often an afterthought. They were so focused on features that organization went overlooked. Coupling was rife between modules. New features were often bolted onto the codebase wherever they could be made to fit. To my disillusioned eyes, it looked like many programmers, if they ever cracked open Design Patterns at all, never got past Singleton.
My God! I’ve lived through this. This experience reflects my own in Relearning Design Patterns.
It goes on to describe how this brilliant code base contained gems that were difficult to unearth because the programmers creating the work had obscured things. They obscured things because of schedule pressure. This sentiment here reflects “Awful Code. Awful Circumstances.”.
Then there is the Service Locator pattern:
Provide a global point of access to a service without coupling users to the concrete class that implements it.
And there it was. A nice pattern for logging.
Serivce Locator references:
Logging best practice: