- 25 hours to Bariloche, but the views are worth it. https://t.co/7W7cN2t1sm 23 hours ago
- RT @SaintGimp: GWB: "No democracy pretends to be a tyranny. Most tyrannies pretend to be democracies. Democracy remains definition of polit… 2 days ago
- Seattle, WA ✈️ Atlanta, GA ✈️ Buenos Aires, Argentina ✈️ San Carlos de Baroloche, Argentina #AdventureTime @nodeconfar we are on our way! 2 days ago
- RT @aaronpk: Super happy to announce that my book "OAuth 2.0 Simplified" is now available! oauth2simplified.com 3 days ago
- RT @GraceStarling4: For those carrying their #MeToo with them silently, you are loved, cherished, and believed. You do not owe your story t… 4 days ago
November 8, 2011Posted by on
I have subscribed to Derick Bailey’s blog for several years. He is one of my favorite Los Techies. I think he has a firm understanding of agile development practices and is one of the many progressive .NET developers to jump ship and start doing Rails development. So I was pretty excited to see he was producing his own screencast series over at WatchMeCode.net.
I am a rabid consumer of screencasts and even attempt to produce some of my own. So I am aware of some of the time and effort needed to create a quality screencast. Derick’s initial offering is a bit pricey at $14 for a single screencast, but you do get to download the video and do whatever you want with it. Derick offers HD 1680×1050 and iOS ready 720p versions. The encoding is very good, text is quite readable and the sound quality is great.
Derick starts out by first wrapping his current plugin’s implementation in a module and explicitly exposing a public API. In this refactoring he introduces a Memento object that represents the public API he wants to expose to users. He then moves on to introduce an internal Serializer object that handles all serialization concerns. This refactoring leaves his original code fairly lean and responsible for stack manipulation, so he names it as MementoStack. While he is focusing on clearly defining single purpose types, he identifies several minor smells like excessive guard clauses and repetitive if switches related to the type of Model being stored. He introduces a TypeHelper type that encapsulates the type decision and exposes a single API, which removes the concern from the other objects. This was a particularly clever refactoring which was worth seeing. After all the refactoring, Derick is able to identify a couple of bits of redundant code that he quickly explains and removes. This refactoring was interesting in that it wasn’t very apparent until the other refactorings had paired his code down to small easily digestible functions. Finally, he breaks a dependency from the MementoStack to the Serializer, by pushing the interaction concern up into the main Memento object greatly simplifying the two and giving the Memento object behavior.
Derick was able to completely refactor his plugin and end the session with his original Jasmine test suit all green. It was very enlightening to to wach him make a modification, run the tests, troubleshoot any failing tests until they passed, then start the whole cycle again. These failing test situations were not simple contrived examples, you could hear the surprise in Derick’s voice as tests failed. Listening to his troubleshooting techniques in these real situations was pretty fun.