个人觉得:1) Properties.load(in)之后直接props.getProperty(key)就可以了,不用遍历转换成map, properties自身是继承Hashtable的。2)PropertiesReader用Singleton实现,可以避免多次重复读取配置文件。
2017-12-04
结合视频学习了
FactoryTest<PersonFactory> personFactory = new FactoryTest<>();
PersonFactory person = personFactory.getInstance(MCFactory.class);
Boy boy = person.getBoy();
boy.drawMan();
FactoryTest<PersonFactory> personFactory = new FactoryTest<>();
PersonFactory person = personFactory.getInstance(MCFactory.class);
Boy boy = person.getBoy();
boy.drawMan();
2017-11-19
FactoryTest<HairInterface> hairFactory = new FactoryTest<>();
HairInterface left = hairFactory.getInstance(LeftHair.class);
left.draw();
HairInterface left = hairFactory.getInstance(LeftHair.class);
left.draw();
2017-11-19