目录
让数据和处理逻辑分离
- 改造前
public class FooAmusementPark {
private FooZoo zoo;
private FooAquarium aquarium;
public void enjoy(FooFamily family) {
zoo.enjoy();
}
public void enjoy(FooCouple couple) {
aquarium.enjoy();
}
}