July 19, 2010
Codemanship's Code Smell Of The Week - Inappropriate IntimacyWhen two classes exhibit an unhealthy fascination with each other's bits, we call the Inappropriate Intimacy. It's essentially bi-directional feature envy. In this video, Jason Gorman demonstrates hot to change a bi-directional relationship into a uni-directional relationship and eliminate the feature envy on both sides.
Download the source code from http://bit.ly/d6QxpG
ERRATA: Refactoring to move getSummary() to Motorist class adds a paramter license, which is not needed and can be safely removed.
For training and coaching in refactoring, TDD and OO design, visit http://www.codemanship.com
Posted 7 years, 11 months ago on July 19, 2010