This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Goal: Restore Drive method to all operate at one level of abstraction. | |
// Refactorings performed: Extract Method x 3 | |
// Hand-edits made: update comment | |
// Why: A method with multiple levels of abstraction is harder to reason about. Drive | |
// was calling a method to do some of its work, then doing direct field operations later. | |
// That causes readers to distrust the one method that was called and have to read it to | |
// understand the whole. | |
// | |
// Now Drive is written entirely in terms of intent. They can choose | |
// to read it and trust all sub-methods. After they accept Drive, they can choose to read |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Data.Services; | |
using System.Data.Services.Common; | |
using System.Linq; | |
using System.Spatial; | |
namespace AllTheNews | |
{ | |
[DataServiceKey("BusinessId")] | |
public class Business |