Back in my delegate decorator article, I mentioned some weaknesses of the delegate pattern as a substitute to inheritance. The decorator solved one of those problems, but the other is still a problem. The problem comes when using something akin to the template pattern. Continue Reading
As many of my readers will likely know, my favorite design pattern is the Decorator Pattern, but I don’t think I’ve mentioned what my second favorite pattern is. This is understandable, as I have a difficult enough time picking favorites usually, let alone second favorites. Well, my second favorite is sort of a toss up between the Factory Pattern and the Strategy Pattern. I almost HAVE to choose the Strategy Pattern though, since the Factory Pattern is essentially a specialization of the Strategy Pattern.
Today, I am going to present an interesting idea about implementing the Strategy Pattern in Python that doesn’t involve making instances of a class or using functions as the strategy object. Continue Reading
I was asked to review a new book by Packt Publishing called Test-Driven Python Development. I was really excited because it combined two of my three favorite programming topics that I can’t seem to stop reading about: Python and TDD/Unit Testing.
The book has many editing mistakes, but does a great, in-depth job of explaining TDD and good testing in Python. Continue Reading