this could be for any number of reasons. the castle wiki has excellent
documentation on how to use Windsor. I would start my testing simple
scenarios and then progressively testing more complex resolutions. Trying to
do everything at once is a recipe for disaster. While it's "good practice"
to reduce your calls to Resolve() it's not an absolute requirement, so I
wouldn't start here.
get it working, then optimize the calls to the container.
typically registration looks like this
container.Register(AllTypes.FromThisAssembly().Where(predicate).WithService.DefaultInterface());
or
container.Register(AllTypes.FromThisAssembly().BasedOn<Type>().WithService.Self());
these are just examples. but the basic concept is
1. define the assembly
2. select components
3. define the service type for the component
a more complex scenario may look like this
AllTypes
.FromAssembly(assembly)
.Where(predicate)
.Unless(predicate)
.Configure(c => c.Named(c.Implementation.Name).Lifestyle.Transient)
.Configure<SpecificType>(c =>
c.Forward<AnotherService>().SeviceOverrides(new{foo = "name of component in
windsor"}))
.Configure<DifferentType>(c =>
c.AsFactory().UsingComponentSelector<MyComponentSelector>())
.WithService.DefaultInterface()
again just examples of what's possible. you may need will probably be
different
--
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.