The class that knew too much: refactoring spaghetti code
The Single Responsibility Principle states that a class should have one (and only one) reason to change. Classes that don't adhere to this principle can result in tightly coupled spaghetti code that leads to more bugs and higher maintenance. We'll look at how to identify these classes by using some heuristics and looking for 'code smells', and we'll clean them up using refactoring tools, design patterns, dependency injection and even aspect-oriented programming. Examples will be in C#, but the concepts can be applied to a variety of languages.
Matthew D. Groves is a guy who loves to code. It doesn’t matter if it’s C#, jQuery, or PHP: he’ll submit pull requests for anything. He has been coding ever since he wrote a QuickBASIC point-of-sale app for his parent’s pizza shop back in the 90s. He currently works as a Developer Advocate for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET (published by Manning), and is also a Microsoft MVP.
- Austin CodeCamp 22 Recordings
- Single Responsibility 1 Recording