Lazy component injection

11/26/2012 8:30:18 PM

Ever felt it's a waste when injected components aren't used in certain execution paths?

In Castle Windsor 3.0 you can do,

.Register(Component.For().ImplementedBy())

and then you can do

public LibrariesController(Lazy> libraries) { // zap construction }

and that's it! Component registration are done as usual.

http://docs.castleproject.org/Windsor.Whats-New-In-Windsor-3.ashx#AddedsupportforLazycomponents3