Posts

Spring Inversion Of Control

Image
  Spring Inversion Of Control Hi everyone, let's  start with a simple example, do follow the blog to get an insight into IOC  (Inversion  Of Control) in spring. Step -1 First create a spring project and then create a package.  In this example I use the spring project name as ioc.  Create an interface called Sim. This interface has two void methods. calling() and data().         Step -2 Now create a class called serviceProviderOne using the Sim interface. This has override calling() and data() methods. Step -3  Create another class called ServiceProviderTwo using the Sim interface. Also override calling() and data() methods.         Step -4 Create a  class named Mobile. This class  has a main method.  You  can use methods in the ServiceProviderOne class and ServiceProviderTwo class as below.  Create objects using these two classes and call these methods. When you run the application  you will get the  following output. If you want to use these methods in multiple classes and locatio