最近再看mybaits源码,注意到
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(resourceAsStream);
这样的一行,想到以前经常有.build()这样的方法出现,了解到这种设计模式叫构建者模式,特此记录。
最近再看mybaits源码,注意到
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(resourceAsStream);
这样的一行,想到以前经常有.build()这样的方法出现,了解到这种设计模式叫构建者模式,特此记录。