Home

Castle Stronghold

Using Configuration Properties

If you have parameters that are used by more than one component or you have a complex system configuration, you may use a properties node which allows you to centralize the configuration. For example:


<configuration>

    <properties>
        <port>10</port>
        <host>smtphost</host>
    </properties>

    <components>
        <component id="smtp.sender" 
            service="Namespace.IEmailSender, AssemblyName"
            type="Namespace.SmtpMailSender, AssemblyName">
        
            <parameters>
                <port>#{port}</port>
                <host>#{host}</host>
            </parameters>
        
        </component>
    </components>

</configuration>

You can specify values to attributes using the same syntax.

Google
Search WWW Search castleproject.org