樓上的方法確實可以實現(xiàn),但是個人覺得properties配置,耦合更低更優(yōu)雅,往后增加新的發(fā)型,就只要修改properties就好了
2015-12-16
properties文件映射多余的,而且還會多出很多難以維護的magic string,
HairInterface left = factory.getHairByClassName(LeftHair.class.getName());
應該這樣調用即可
HairInterface left = factory.getHairByClassName(LeftHair.class.getName());
應該這樣調用即可
2015-12-12