Showing posts with label Igloo. Show all posts
Showing posts with label Igloo. Show all posts

Tuesday, July 23, 2013

A Double Dispatch example in C++ using Igloo

To practice I've coded an example of the Double Dispatch implementation pattern I read about first in Rebecca Wirfs-Brock's Object Design: Roles, Responsibilities, and Collaborations and later in Kent Beck's Implementation Patterns.

I used the pattern to implement the rules of the Rock-paper-scissors hand game.

I drove the code using TDD.
Having a "dense day", I painted myself into a corner, but I finally managed to refactor my way to a solution.

I used the Igloo C++ BDD framework, which the more I use, the more I like.

I put the resulting code in this repository. I committed after each new test was made to pass and after each refactoring, so you can follow all the process (including my silly initial mistakes).

Sunday, June 9, 2013

Kata: "StringCalculator" in C++ using Igloo

Today I've worked in the StringCalculator kata in C++.
It's been perfect to start using Igloo, the BDD framework I talked about in my last post.

Here it's the code. It's incomplete. I still have to do the steps 7, 8 and 9 that deal with multiple delimiters and delimiters of any length.

Playing with Igloo, a BDD framework for C++

Today I've been playing with Igloo which is a BDD framework for C++.

I like it. The specs are very readable and, as it is implemented as a set of header files, it's really easy to use in your project. Its documentation is also ok.

Its author, Joakim Karlsson, has done several screencast where you can see him using Igloo. You might also have a look at Igloo's source code.