This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line! See this thread for details.
I'm new to the Spring Frame work,I have a ServiceImpl class and Though I'm not defining <Bean> Property properties in the context.xml the auto wiring is working to look up the dependency objects of the ServiceImpl class.Let me explain using an example,The below Dependency Injection is happening even I'm not mapping the Dao reference to the bean.Please share your thoughts
First, component-scan element configures Spring to scan all classes under specified package and autodiscover beans. That's how it's able to find your DAO.
You don't need a <bean> tag for the service bean either; it too will be autodiscovered.
Read about component scanning here.
Second, default behaviour of autowiring is to match by type. Your setTrackingDao setter method tells Spring to use setter based dependency injection. It checks the type of the member, sees that it's a TrackingDao, finds the TrackingDao class as part of component scanning, creates an instance of it, and injects it into your service bean.
Read about setter based DI here.
Important: From now on, when posting in CodeRanch, ensure that you enclose all code snippets in your question inside Code Tags for improved readability. See https://coderanch.com/t/659781/Wiki/Code-Tags for instructions. I'll edit your post and do it for you this time.