Runar Ovesen Hjerpbakk

Science-based software development

New features in FermiContainer 1.1

FermiContainer gains features, but while doing so becomes even more simple. How is this possible? Let me tell you:

Automatic resolving of constructor arguments

Through constructor injection, the dependencies known to the container are automatically resolved. No attributes or XML configuration are needed.

public void Register_EvenMoreComplexClass_CanBeResolved() {
m_fermiContainer.Register<IEvenMoreComplex, EvenMoreComplex>();
m_fermiContainer.Register<ICalculator, Calculator>();
m_fermiContainer.Register<IComplex, ComplexClass>();

var complexInstance = m_fermiContainer.Resolve<IEvenMoreComplex>();


public interface ICalculator {}

public class Calculator : ICalculator {}

public interface IComplex {}

public class ComplexClass : IComplex {
public ComplexClass(ICalculator calculator) {}

public interface IEvenMoreComplex {}

public class EvenMoreComplex : IEvenMoreComplex {
public EvenMoreComplex(
IComplex complex, I
Calculator calculator,
ClassWithoutInterface classWithoutInterface) {}

public class ClassWithoutInterface {}>

Default container instance

var instance = FermiContainer.DefaultInstance;

Assert.AreSame(instance, FermiContainer.DefaultInstance);

Easier to extend

The Services dictionary is now protected so FermiContainer is easily extendable.

Better performance

C# expressions makes FermiContainer very performant.

Available as source through NuGet

PM> Install-Package FermiContainer.Sources