2010-08-23

The Shu Ha Ri of Inheritance versus Composition

For ages now, there is an ongoing discussion (to not say war) in the OO communities on wether it makes sense to prefer Composition over Inheritance or not.

My personal impression is that a lot of the heated debate stems from confusing advice given to beginners with what the experts do. A useful mental tool I like to use in occasions like this is the concept of Shu Ha Ri. Here is how I currently think about it:

Shu

You are (relatively) new to object oriented design. Inheritance is rather easy to understand, polymorphism a little bit more abstract. Inheritance is easy to do, composition a lot more work, or so it seems. It's likely that you are overusing inheritance, and that you could benefit from making more use of composition. That's fine, it's the usual learning step you have to take. Once you experienced how inheritance works (and where the problems lie), it's good advice to favor composition over inheritance, so that you can learn what the pros and cons of that approach are.

Ha

You have experienced the perils of overusing inheritance. You have experienced the flexibility that composition brings you - and where investing into composition actually doesn't seem to pay back much. It's time to start experimenting with a balance of inheritance and composition, and to find your own rules of when to use which.

Ri

Thinking in terms of inheritance versus composition doesn't make much sense to you. You know that both are just tools in your quest of producing maintainable, SOLID code. And you can easily refactor code from using inheritance to composition and back on a whim, so why make a fuss about it? Just use whatever your gut tells you makes sense at the moment.

2010-03-03

The Aha-Experience Exercise

The Aha-Experience exercise is a simple exercise that I learned about November last year during Alistair Cockburn's CSM + Crystal course (which I highly recommend). I have since used in a four day Scrum workshop for college students, together with Heiko Stapf. I really like it, and, with the permission of Alistair, I'm hereby sharing it with you.

This exercise is especially useful for trainings that span several days. It
  • allows participants to reflect on their personal learning highlights,
  • lets them share their insights,
  • provides regular feedback to the trainer about what parts of the material gets the trainees attention and how they interprete it, and
  • organically and collaboratively lets an artifact emerge that will remind participants of their main lessons from the training.

 

How it works:


This is my take on how to execute this exercise. While I think that it's close in spirit to what Alistair does, there are probably also many details mentioned below that are more rooted in my personal experiences and values than in observing Alistair facilitate this exercise.

 

First round of gathering aha-experiences (15 min.)


Start with the exercise early in the training. A good point in time is when you covered enough material for the participants to have aha-experiences to report, but early enough that it still feels like the start of the training. Typically that will be after the first one or two lessons/exercises, not more than two hours into the training.

Hand out a block of sticky notes (extra-sticky, if possible) and a marker to every attendee. Ask them to take a few minutes to think about and write down two aha-experiences, each on its own sticky note. An aha-experience could be something that surprised them, something that got their attention, or simply something they want to make sure to remember. (It's often not too hard to come up with one aha-experience, but having to come up with a second might require some deeper digging. See it as a challenge that your trainees might need some gentle support for, in contrast to a requirement that needs to be enforced.)

When they finished writing, go around the room and ask every participant to quickly read his/her aha-experiences aloud. Thank everyone for the contribution. Don't allow discussions at this point - the goal is to just get a sense of what the group has learned until now. Don't critizise a "wrong" aha-experience, as you don't want your trainees to censor themselfes out of fear of being publicly critized. Take it as valuable feedback that you can use to adjust coming parts of the training.

After the last participant presented his/her aha-experiences, ask them to stick their notes to a wall that you reserved for this purpose. It should provide lots of space for adding more notes later during the training, and should be easily visible for the attendees throughout the training (that is, a wall in their back isn't a good choice). A front of windows works well, too.

Finally, tell participants to keep looking for aha-experiences for the rest of the training. Whenever they have one, they should immediately write it down on a note and stick it to the wall.

 

Keep it flowing


If you are lucky, your trainees will happily accept the invitation and continue posting aha-experiences to the wall. Just make sure that sticky notes and markers are always easily accessible. Make it your morning ritual to check all tables and replenish supplies where necessary.

Depending on the group and the room layout, you might need to gently remember the group to continue posting aha-experiences and to look at what others have written. You might even want to schedule short slices of time just for reflecting on the training and writing sticky notes. Five minutes just before lunch break have worked well for a group that otherwise wouldn't write down any aha-experiences.

 

Debriefing (20 min.)


As part of the debriefing for your training, give participants one last explicit chance to stick more aha-experiences to the wall.

Then let the group gather in front of the wall (you might need to make some room), and group duplicates. Everyone should look at the posted notes put together those that seem to say the same thing. If the text actually is different, it helps if they are both still readable. Encourage discussions; if the author of a note argues that it is different from another note, that should be respected and the notes not be considered duplicates.

When things settle down, hand out sticky dots. Ask participants to put a dot on every aha-experience that's important to them personally. Every participant can use as many dots as s/he wants, one dot per aha-experience.

When dots have been alloted, read aloud one to two handful of top-voted aha-experiences. Depending on the number of sticky notes and the obviousness of the distribution of dots, you might want to sort the notes by number of dots, first.

Let the group discuss observations: are there any surprises? Is there something missing? Have there been important learnings that didn't manifest in aha-experiences?

Finally, take one or more photos of the notes on the wall (the notes should be easy to read on the photos) and provide them to the participants as part of the training documentation.

 

Conclusion


I like the way this exercise continuously involves the participants in the training and puts a focus on their individual and collective learning. I will definitely use it again in the future for trainings that span more than a day. I wonder how well it would work for shorter trainings, or how it might need to be adjusted.

If you try this exercise or variations of it, please let me know what you learn!

2010-02-16

Come to Agile Coach Camp Germany!

Events
I'm so excited about Agile Coach Camp happening in Germany at the beginning of May this year! Being part of such a passionate organizing team is amazing. And I think the motto "Wavemaking - gently creating radical change" is just brilliant. Talk about the creativity of teams!

Due to the size of the venue, we are limited to just 50 places, and the list is filling up quickly. So, go and register! Or get more information first, if you aren't convinced, yet.