Сообщения

Сообщения за ноябрь, 2024

IoC:ApplicationContext, BeanFactory. Bean

 Bean - bean is an instance of a class managed by Spring Boot. package com.appsdeveloperblog.ws.demotransaction2; import org.springframework.stereotype. Component ; @Component public class Customer { private String name ; public Customer (String name) { this . name = name; } } package com.appsdeveloperblog.ws.demotransaction2; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure. SpringBootApplication ; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation. Bean ; @SpringBootApplication public class DemoTransaction2Application { public static void main (String[] args) { ApplicationContext apc = SpringApplication. run (DemoTransaction2Application. class , args); for (String s : apc.getBeanDefinitionNames()) { System. out .println(s); } } @Bean public String getName () { return "Parvin" ; } } ---- About ap