OCP Dojo at the XP Days Benelux 2010

OCP Dojo at the XP Days Benelux 2010

Last week I presented with Antonio Carpentieri The Open/Closed Principle Dojo at the XP Days Benelux 2010. 19 people attended; I’m happy that we received positive feedback and good criticism.

In the feedback for our session, someone wrote in the “what I like”:

  • Refactor before implementing new stuff
  • Can apply this on Monday

In the general feedback about the conference someone wrote, in the “Which (new) things are you going to apply or investigate further?”

  • The Open/Closed Principle
  • Pomodoro technique
  • IFs are evil

I’m also happy that Marc Evers and Rob Westgeest did a demo of the OCP Dojo at the NLJug last month.

2 Responses to “OCP Dojo at the XP Days Benelux 2010”

  1. Carlo Garatti Says:

    Matteo,
    i try to do the FizzBuzz and, apart the “if solution”, i agree with your solution (you can see mine here: https://github.com/carlino/TDDFizzBuzz). Is difficult to explain but if i design in TDD, i reach the solution with the if’s. During the development i’m feeling that the solution is not good, so i stop and redo. My question is: naturally my mind tend to arrive at ifs design in TDD. Is very difficult (lets me say, not natural) arrive to the solutions with the objects in TDD (maybe for me!!:D). In your experience? in my opinion this is the very difficult part of TDD!!!
    Ciao :D

  2. matteo Says:

    Hello Carlo,

    nice to hear from you. I read your solution and I see there are still IFs you could eliminate, in the ModuleNumber.factiory. I suggest you to try the “decorator” and/or the “chain of responsibility” patterns. Start with this setup:

    FizzBuzzer fizzBuzzer;

    @Before
    public void build() {
    fizzBuzzer = new FizzBuzzer();
    }

    @Test
    public NumberIsNotAMultipleOfThreeOrFive_thenSayTheNumber() {
    assertEquals(“1”, fizzBuzzer.say(1));
    assertEquals(“2”, fizzBuzzer.say(2));
    assertEquals(“4”, fizzBuzzer.say(4));
    }

    and then try to follow the rules *to the letter*. You should arrive at a different result…

    Matteo

Leave a Reply