Showing posts with label IoC. Show all posts
Showing posts with label IoC. Show all posts

Thursday, September 23, 2010

Decomposition in functional languages

Got an idea: functions (in FP) could be composed similar was as components in OOP. For example with dependency injection. For components in OOP we use interfaces. For functions we could use delegates. To achieve decomposition and modularity.
I tried to find something about it. No luck. Probably because there are no functional programs big enough to need this ?
While searching for enterprise scale applications written in FP I found this list. Functional Programming in the Real World and this paper

I hope I just missed the killer application for FP, which would be big enough to deserve decomposition. Maybe someone could find me answer at stack overflow.

Wednesday, June 17, 2009

Unity IoC - context aware

Unity will inject it self into constructor or property with IUnityContainer interface. No need to implement any "ApplicationContextAware"
public class Something
{
    //use this
    public Something(IUnityContainer container)
    {
        Container = container;
    }

    //or this
    public IUnityContainer Container { get; set; }
}
Found here