Item 5: Prefer dependency injection to hardwiring resources(依赖注入优于硬连接资源)
Manyclassesdependononeormoreunderlying(adj.潜在的,根本的)resources.Forexample,aspellcheckerdependsonadictionary.Itisnotuncommontoseesuchclassesimplementedasstaticutilityclasses(Item4):许多类依赖于一个或多个底层资源。例如,拼写检