2009/9/23 Krzysztof Koźmic <[email protected]>

> Ok - almost like a charm.
>
> There are two issues:
>
> - When I want to expose a new parameter, I now have to add it in two
> places.
> The propperties file and the resource config file that uses it?
>


> - I can't (or can I?) define default values, so that I can skip declaring
> them in the config
> Not sure if there is enough support for this, will have to check
>
> Craig Neuwirt wrote:
>
> Thats what I always did back in the xml days and it worked out pretty nice
>
> 2009/9/23 Krzysztof Koźmic <[email protected]>
>
>> Hmmm,
>>
>> actually you may be right...
>>
>> If I split this into two files, one having only parameter definition, and
>> second one with components #{referencing} the parameters and referencing the
>> 1st one it could be just good enough...
>> especially if I kept the 2nd one as embedded resource in my assembly to
>> hide it from the admin...
>>
>>
>>
>> Craig Neuwirt wrote:
>>
>> Right. and it has support for defines which improve readability and basic
>> conditionals
>>
>> 2009/9/23 Krzysztof Koźmic <[email protected]>
>>
>>> You mean ConfigurationInstaller ?
>>>
>>> I don't think so - after quick check it looks like it works only for the
>>> standard structure.
>>>
>>> Krzysztof
>>>
>>> Craig Neuwirt wrote:
>>>
>>> So are you gonna be able to use the standard xml configuration parsing?
>>>
>>> 2009/9/23 Krzysztof Koźmic <[email protected]>
>>>
>>>> Say,
>>>>
>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>> <configuration>
>>>>   <components>
>>>>     <component id="foo">
>>>>       <parameters>
>>>>         <name>Krzysztof</name>
>>>>       </parameters>
>>>>     </component>
>>>>   </components>
>>>> </configuration>
>>>>
>>>> vs
>>>>
>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>> <configuration>
>>>>     <foo name="Krzysztof" />
>>>> </configuration>
>>>>
>>>> Craig Neuwirt wrote:
>>>>
>>>> How much baggage is there as is?
>>>>
>>>> 2009/9/23 Krzysztof Koźmic <[email protected]>
>>>>
>>>>> That's right.
>>>>>
>>>>> I guess I'm gonna play with creating a facility for this to have the
>>>>> minimal syntax baggage possible.
>>>>>
>>>>> James Curran wrote:
>>>>>
>>>>> So, the correct form is the following??
>>>>>
>>>>>             IWindsorContainer container = new WindsorContainer()
>>>>>                 .Install(Configuration.FromXmlFile("Config.admin"))
>>>>>                 .AddComponent<IMyComponent, MyComponent>("foo");
>>>>>
>>>>>
>>>>> 2009/9/23 Krzysztof Koźmic <[email protected]> 
>>>>> <[email protected]>:
>>>>>
>>>>>
>>>>> Craig,
>>>>>
>>>>> I found my stupid mistake :)
>>>>> I need to load the xml first,
>>>>> then do AddComponent...
>>>>>
>>>>>
>>>>> Krzysztof
>>>>>
>>>>>
>>>>> Craig Neuwirt wrote:
>>>>>
>>>>> Sounds nice.  I'll have to take a look
>>>>>
>>>>> 2009/9/23 Ayende Rahien <[email protected]> <[email protected]>
>>>>>
>>>>> I am reading it via a facility and setting the appropriate things on the
>>>>> configuration.
>>>>> It means that I get a NICE config syntax, which is very admin friendly
>>>>>
>>>>> 2009/9/23 Craig Neuwirt <[email protected]> <[email protected]>
>>>>>
>>>>> Hey Ayende,
>>>>>   Are you doing something different for your Rhino Service Bus?
>>>>> craig
>>>>>
>>>>> 2009/9/23 Ayende Rahien <[email protected]> <[email protected]>
>>>>>
>>>>> Take a look at how I am doing things for the Rhino Service Bus.
>>>>> And take a look here:
>>>>> http://ayende.com/Blog/archive/2008/12/31/didja-know-merging-windsor-configuration-with-automatic-registration.aspx
>>>>>
>>>>> 2009/9/23 Krzysztof Koźmic <[email protected]> 
>>>>> <[email protected]>
>>>>>
>>>>> My goal is to have the following:
>>>>>
>>>>> - register all the components in the code
>>>>> - externalize some of configuration options (like addresses and ports,)
>>>>> to external config file that a non-programming admin would edit.
>>>>> - be able to specify defaults for these options in code, and override
>>>>> these from the config if present
>>>>>
>>>>> The major point is to have just the minimal necessary amount of stuff
>>>>> put in the config file, to keep it clean, minimal and as readable as
>>>>> possible -  something like: http://gist.github.com/191862
>>>>>
>>>>> Now, Henry pointed me to Configuration.FromXmlFile method, but it seems
>>>>> to be working with the full blown windsor config files only, which I
>>>>> want to avoid, if only to make sure admin can't screw my component
>>>>> registration.
>>>>>
>>>>> Do we have some way of doing this baked in? If no, would you see it
>>>>> beneficial to have that in the framework?
>>>>>
>>>>> Krzysztof
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to