0% found this document useful (0 votes)
2 views

Spring Framework Core

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Spring Framework Core

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Spring Framework Core:

IOC:

the ioc container which reads the config file and create objects present in that
class

for creating a obj by the user he has to use getBean("obj name",Class name.class)

there are two types of Ioc Container


1: Bean Factory,
2:ApplicationContext

ApplicationContext implments class ClassPathXmlApplicationContext

for creating a obj


create an xml file and create an obj by
After creating reference to the class getBean("obj name",Class name.class)
we can call the methods

we have call by the interface reference Sim

*<bean id ="obj name" class="paste the qualified name"> <bean> in xml file*

ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");


system.out.println("config loaded");
Airtel air = context.getBean("airtel",Airtel.class);
air.call();
air.talk();

Sim sim= context.getBean("sim",Sim.Class);

Spring dependency injection :

which means without combining two classes but combining the classes by takinng the

private classname f;
by consturctor and getter setter methods we can add the values

Annotations :

@component which is used to make the objects


ApplicationContext = new AnnoationConfigApplicationContext(College.Class);
Classname obj= context.getBean("obj",Classname.class);

in this component if we didn't provide

@Bean=(name={"colbean","collehege"}) for multiple bean providing

@propertySource("classpath:file name")
file name is used in property source
in file collage name =

You might also like