70 likes | 182 Vues
Day 2 of the Spring Framework workshop covers Workspace Setup, BeanFactory Container, IoC Principle, ApplicationContext Container, and hands-on HelloWorld program verification. Learn about IoC, Dependency Injection, and various implementations. Get ready to dive deeper into Spring's core concepts.
E N D
Spring Framework – Day 2 Presented By ParimalaAppLabs parimala.applabs@gmail.com
Agenda • Quick recall of day 1 • Workspace setup checklist • HelloWorld program • Spring IoC • What is IoC • Spring BeanFactory Container • Spring ApplicationContext Container
Workspace Setup • JDK Setup? • Eclipse Setup? • Jars Download? • Logging Jars • Spring Jars • Verify
HelloWorld Program • Step 1: New Java Project and External Jars • Step 2: Define Bean (HelloWorldBean) • Step 3: Define metadata • Step 4: Write Tester Class (HelloWorldBeanTester)
Spring IoC • Core of the Spring frame work • Inversion and Control • Don’t call me. I call you • Create objects, wire the dependency and manage the lifecycle • Dependency Injection • Meta Data definition
Spring IoCContainer (cont.....) • BeanFactoryContainer. • Simple and light weight. • Implementation of BeanFractory Interface. • Implementations • Xml BeanFactory • ApplicationContentContainer • Can do all that of BeanFactory (sub class) • Adds enterprise capabilities • Resource bundle • Events propagation
ApplicationContextContainer (cntd…) • Implementations(differ in the way metadata is loaded) • FileSystemXmlApplicationContext • Reads from the absolute path • ClassPathXmlApplicationcontext • Xml must be in the classpath • WebXmlApplicationContext • Gets Xml reference from web. xml • Works for web application only