SRP with the DC ALT.NET User Group in Alexandria, VA
Last Wednesday (3/25/2009), I presented at the DC ALT.NET User Group in Alexandria. Thank you to the groups organizer, Matt Podwysocki for inviting me.
Writing Code with the Thycotic Team
The presentation was TDD with C# and Mocks - which is a hands-on coding session with the audience working on a real application (our online store codebase) - the new code is designed to track website visitors for marketing purposes and it has lots of external dependencies (cookies, database persistence). The goal of the session is to demonstrate how the Thycotic team would write code using C#, RhinoMocks and the Single Responsibility Principle (SRP).
Single Responsibility Principle
SRP involves writing mostly new classes since everything is almost always a new responsibility and therefore gets its own class (see also the Open Closed Principle since SRP works well with the concept of open for extension, closed for modification). This makes it easy to work in legacy code if you adopt SRP as you seldom modify the existing code but rather spend most of your time developing the tests and behavior in new classes and then wire them in where necessary. There are many other benefits to SRP including testability and reduced coupling.
The audience at the event was engaged and asked lots of interesting questions. There were questions regarding the wire up of dependencies which led to some tangents on Inversion of Control containers and so on.
Fishbowl Conversation
Matt also held a fishbowl conversation in the beginning of the meeting which seemed like a fun way to get attendees engaged and sharing opinions. I hadn't seen this used before but I was impressed with the concept.
Jonathan Cogley is the CEO of Thycotic Software, an agile software consulting and product development company based in Washington DC. Don't forget - we will be holding our two-day Test Driven Development course next month - reserve your spot now.