Monday, August 18, 2008

IOC (Inversion of Control) - An Introduction to Spring

As usually we need Eclipse as IDE. We also need other libraries such as Spring Framework libraries and Jakarta Commons libraries especially commons-logging. Create a project named IoCDemo. In this project create a new folder named lib and move all our libraries into this folder. Create a library properties file, lib.properties. This is my library configuration properties. Make it in your own. Also configure build path our project into these libraries.

lib.properties

Then in source folder make two packages named com.ndung.myspring and com.ndung.main. In com.ndung.myspring create a java interface named Greeting.java and a java class named GreetingImpl.java. In source folder create a xml file as configuration of our spring injection named Hello.xml and in package com.ndung.main create a main java class named Main.java.

Greeting.java


GreetingImpl.java


Hello.xml


Main.java

We will run this project by using Ant. Create a xml file in this project named build.xml and run this project.

build.xml

2 comments:

Anonymous said...

Hello,

can anyone tell me which is the best counter strike guide ? :)...i found this one :

http://www.downloadzdb.com/Counter_Strike_Best_Guide

What do you nigh harshly it ?

Thanx in advance

Sorry for my bad english :s

Anonymous said...

hello ppl. I'm really into shoes and I was searching for the sake of that exact brand. The prices due to the fact that the shoes are around 230 pounds on every site. But definitively I set this location selling them for the benefit of half price. I in reality love those [url=http://www.shoesempire.com]gucci sneakers[/url]. I will absolutely buy these. what can you say about it?