讲述了JavaSpring:Spring容器如何新建Bean的实例
树图思维导图提供 JavaSpring-Bean的Scope 在线思维导图免费制作,点击“编辑”按钮,可对 JavaSpring-Bean的Scope 进行在线思维导图编辑,本思维导图属于思维导图模板主题,文件编号是:ca4a17ab58bf92715c8450dadce7a8bd
JavaSpring-Bean的Scope思维导图模板大纲
@Service //1 public class DemoSingletonService { }
@Service @Scope("prototype")//1 public class DemoPrototypeService { }
@Configuration @ComponentScan("com.wisely.highlight_spring4.ch2.scope") public class ScopeConfig { }
public class Main { public static void main(String[] args) { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ScopeConfig.class); DemoSingletonService s1 = context.getBean(DemoSingletonService.class); DemoSingletonService s2 = context.getBean(DemoSingletonService.class); DemoPrototypeService p1 = context.getBean(DemoPrototypeService.class); DemoPrototypeService p2 = context.getBean(DemoPrototypeService.class); System.out.println("s1与s2是否相等:"+s1.equals(s2)); System.out.println("p1与p2是否相等:"+p1.equals(p2)); context.close(); } } s1与s2是否相:true p1与p2是否相:false
树图思维导图提供 统计 在线思维导图免费制作,点击“编辑”按钮,可对 统计 进行在线思维导图编辑,本思维导图属于思维导图模板主题,文件编号是:d814adf3d5c49be52df99af7591514a6
树图思维导图提供 干细胞临床研究组织的管理体系组织架构图 在线思维导图免费制作,点击“编辑”按钮,可对 干细胞临床研究组织的管理体系组织架构图 进行在线思维导图编辑,本思维导图属于思维导图模板主题,文件编号是:884465dda1ff749e29ec8542d9a58da3