Hi, I have just faced a nasty issue with component dependencies and would appreciate any advice on the topic.
I had component with a singleton lifestyle to which at some point I added a constructor dependency on another component. The other component had a lifestyle with a smaller scope and I ended up obtaining strange exceptions due to the misalignment of the components. In particular the dependency was tied to the web request, so in subsequent requests I ended up using data pertaining to the request in which the containing singleton component was created for the first time. This is all pretty common and in fact I usually am very careful to adjust component lifestyles when adding dependencies, but I would like to automate it so that the container warns me in case the lifestyle of a dependency has a smaller scope that that of the client. I tried playing with the events on the Kernel but it looks like none of them passes me data about the ComponentModel of the dependency being/been resolved. -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
