does strucutremap has interception capabitlities, why do i need another library like windsor castle for that? is there a native way from structuremap to do that?
AOP Logging with StructureMap is a similar question but the answer resides back to a castle proxy.
thanks
The documentation answers this:
StructureMap 2.5+ added the ability to postprocess or even intercept and replace the objects being created. While StructureMap will never include its own Aspect Oriented Programming model (the world does not need a new one), the interception techniques shown below could be used to apply runtime AOP from existing AOP tools like the Policy Injection Application Block from Microsoft.
In general, interception is specified in three ways:
1)
OnCreation()
-- Registers an Action to run against the new object after creation2)
EnrichWith()
-- Registers a Func that runs against the new object after creation and gives you the option of returning a different object than the original object3) A custom class that implements the
TypeInterceptor
interface (the runtime model behind all the interception techniques)
So in short StructureMap's interception capabilities deals with manipulating/replacing configured objects in the container - not applying AOP style interception.
So to summarize:
does strucutremap has interception capabitlities
Yes, but not for AOP-style interception
why do i need another library like windsor castle for that?
Because AOP is not in scope for the StructureMap architecture. There are already multiple good solutions (including Castle Proxy).