Seems that the current behavior is to propagate the additionalArgs
which makes me a bit uncomfortable. Think about it: every parameter
set on that dictionary will be matched by name, without a scope. This
has a great potential of name clashing leading to unexpected behavior.
I have commented the code that propagates it (CreationContext
constructor that takes a parent context) but even that isn't good
enough.
As an user I'd expect a very well defined and predictable behavior. So
for a usage like
var sender = container.Resolve<IEmailSender, new { Host = "somehost" }>();
I would expect that the host of the IEmailSender will be the only one
affected, not any dependency that the email sender happens to have..
does that make sense?
Currently I believe this is the behavior I left but more tests or
thinking are appreciated. The construction graph is inverted if
dependencies are set through constructors but I'd hope that the root
CreationContext will be tied to the root component/default handler.
Thoughts?
--
Cheers,
hammett
http://hammett.castleproject.org/