SpringBoot9AM 07122020
SpringBoot9AM 07122020
Demo#1
https://www.youtube.com/watch?v=L7zUhVLgoBA
Demo#2
https://www.youtube.com/watch?v=oCG4w6Rkcag
Spring container,
a) Detect (Scan) our classes and create object
b) Provid data to object created
c) Link objects based on relations (HAS-A/Association Mapping)
d) Finally Destory objects (when we stop application)
--Sample code--
@SpringBootApplication
public class DemoApp {
public static void main(String[] args) {
SpringApplication.run(DemoApp.class,args);
}
}
-------------------
*) Spring container two types:
a) BeanFactory(I) (XML) [Legacy Container]
b) ApplicationContext(I) [XML/Java*/Annotation**] [new container]
---Examples-----------------------
@Component
class DbConn { }
=> Creates object using className first letter small in spring container
DbConn dbConn = new DbConn();
@Component("con")
class DbConn { }
@Component
class DbConn {
@Value("OracleDriver")
String driver;
}