How to insulate yourself from static methods

Sometimes your code needs to call a static method in a 3rd party library and unit testing suddenly becomes difficult, particularly when that static method requires context in order to work. Enter the insulating class (also known as a Facade). Create a new interface that declares a method with the same signature as the static method you want to delegate to Create a new Facade class that implements the interface Replace the calls to the static method with calls to your new Facade class Let’s assume that the method you need to call looks like this [Read More]

How to be Agile when using 3rd party software framework

It can be difficult to be Agile when working with 3rd party software framework. The vendor product may dictate many aspects of the software architecture thwarting your attempts at automated testing and continuous build. However there are steps you can take to make Agile easier. I’ll discuss a few of the options that have worked for me on my current project. Insulate yourself from static methods. Introduce wrappers (Facades) to vendor classes. [Read More]