concept lease in category .net
appears as: lease

This is an excerpt from Manning's book Dependency Injection in .NET.
You deal with this by exposing a lazy-loaded Lease property
. The first time you read it, it invokes the ResolveLease method to figure out what the lease should be. It uses a default lease but attempts to look up an alternative through the Kernel
—if there’s a Kernel at all. I think this is a pretty good illustration of the demerits of METHOD INJECTION. Notice that if anyone reads the Lease property before the Init method is called, the default lease will be used even if the Kernel contains an ILease component. However, because Castle Windsor knows nothing of the Lease property, this doesn’t happen in normal use.
. The first time you read it, it invokes the ResolveLease method to figure out what the lease should be. It uses a default lease but attempts to look up an alternative through the Kernel
—if there’s a Kernel at all. I think this is a pretty good illustration of the demerits of METHOD INJECTION. Notice that if anyone reads the Lease property before the Init method is called, the default lease will be used even if the Kernel contains an ILease component. However, because Castle Windsor knows nothing of the Lease property, this doesn’t happen in normal use.