Sunday, October 24, 2010

Apache ANT


Apache Ant is a software tool used for automating software build process. Ant is implemented using Java language and requires Java platform for it to run. Ant is best suited for building Java projects.

Ant uses XML to describe the build process and its dependencies.


What is Inversion of Control (loC)


The Inversion of Control (and also Dependency Injection) patterns concerned with removing dependencies from your code.

public class TextEditor
{
private SpellChecker checker;
public TextEditor()
{
checker = new SpellChecker();
}
}

In the above code sample we have created a dependency between the TextEditor and the SpellChecker. in an ioC scenario we would instead do something like this.

public class TextEditor
{
private ISpellChecker checker;
public TextEditor(ISpellChecker checker)
{
this.checker=checker;
}
}

Now, the client creating the TextEditor class has the total control over which SpellChecker implementation to use. We're injecting the TextEditor with the dependency.