Category: OOP

Cyclomatic Complexity

4/10/2015 · 4 min read

Imagine you’re having a great day at the office, you’ve got a brand new feature the customer is dying to have, and you’ve completed it in record time. You’re all ready to get it merged and peer reviewed. So you commit it, and push it to your build pipeline, where it’s analyzed. The build fails. Your analytics tool tells you complexity is too high! You’re given a numeric complexity value for your code, and a lower complexity value that you need to get your code’s complexity under.

Read On

CRC Models

3/10/2015 · 3 min read

Yesterday I had fun breaking down a complex system into simpler classes using CRC Models. CRC Models are Class Responsibility Collaborator models, and it allows you to identify classes that aren’t quite doing what they should be. Typically a key instance of when this practice is useful is if a system is consistently described as confusing, or people keep questioning if thing X should really live there. These phrases are symptomatic of a poor object class name/responsibility/collaborator match.

Read On