Hi João,

Thanks for your feedback. I'd be interested to know more about your process of 
looking for information in the documentation wiki. and how we could improve it 
to make it easier to work with.

regarding your other issue, as FAQ mentions (in 
http://docs.castleproject.org/Windsor.FAQ.ashx#Why_is_Windsor_not_able_to_inject_array_or_list_of_components_10)
 you need to add CollectionResolver in other to be able to resolve collections 
(including arrays)
http://docs.castleproject.org/Windsor.Resolvers.ashx#_CollectionResolver__4


HTH,
Krzysztof


--  
Krzysztof Kozmic


On Saturday, 22 June 2013 at 3:05 AM, João Carvalho wrote:

> Hi all,
>  
> I'm a beginner here so I 'm trying to understand and use Castle Windsor.  
>  
> I found this 2007 old tutorial 
> (http://dotnetslackers.com/articles/designpatterns/InversionOfControlAndDependencyInjectionWithCastleWindsorContainerPart1.aspx)
>  and some other posts and of course the castle wiki documentation... and that 
> tutorial was imo the better one for someone like me trying to use windsor 
> step-by-step ; but it looks that it is based in a older version of windsor. 
> Although works fine it does not show hot to install and register components 
> programmatically. All configuration are made with configurations files. I 
> tried to use the fluent api to do the registrations but with no success.  
>  
> That app is just a simple app that downloads some html uri's and lookup the 
> contents to extract some string (in the case the Title of the page); it uses 
> 2 services, one for the donwload (IFileDownloader) and one for the string 
> extraction (ITitleScraper). There are 3 implementations for the downloader 
> one with http protocol,other one with ftp and other one with file protocol 
> and also 2 implementations of the scrapper, one using simple string search 
> and the other using regular expressions. Also, one of the implementations is 
> on a different class library, like the interfaces are in a diferent one.  
> (class diagram attached)
>  
> There is a component (HtmlTitleRetriever) that uses and depends on those 
> services that the app uses to do the job.  
>  
> With xml configuration one can install all types and components and also 
> inject dependencies to the constructor of the component. (xml configuration 
> are attached) The tutorial shows very well how to inject properties and 
> parameters on the constructor.  
>  
> My question:  
>  
> 1. how to do the same thing using the fluent api? install and register all 
> types and components involved and inject the exact some properties and 
> parameters at runtime and not at compile time and ; is it possible to do all 
> this without using xml configuration files?   
>  
> I tried to do this :
>  
> IWindsorContainer container = new WindsorContainer();
>  
> container.Register(
>     
> Classes.FromAssemblyInThisApplication().BasedOn<IOCApp02Interfaces.IFileDownloader>().WithServiceBase(),
>     
> Classes.FromAssemblyInThisApplication().BasedOn<IOCApp02Interfaces.ITitleScraper>().WithServiceBase(),
>     Component.For<HtmlTitleRetriever>()
> );
>  
> This register my components but I come with a "Potentially misconfigured 
> components:" HtmlTitleRetriever
>  
> Some dependencies of this component could not be statically resolved. 
> 'IOCApp02.HtmlTitleRetriever' is waiting for the following dependencies: - 
> Service 'IOCApp02Interfaces.IFileDownloader[]' which was not registered.
>  
> Can someone help? Or direct me for some good documentation/tutorials?  
>  
> Thanks
>  
>  
> --  
> You received this message because you are subscribed to the Google Groups 
> "Castle Project Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> (mailto:[email protected]).
> To post to this group, send email to [email protected] 
> (mailto:[email protected]).
> Visit this group at http://groups.google.com/group/castle-project-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>   
>   
>  
> Attachments:  
> - app.config
>  
> - properties.config
>  
> - components.config
>  


-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to