Dashboard > GreenPepperOpen > ... > Developer Examples > Windsor Castle System Under Development
  GreenPepperOpen Log In View a printable version of the current page.  
  Windsor Castle System Under Development
Added by Laurent Cobos, last edited by Francois Denommee on Mar 20, 2009  (view change)
Labels: 
(None)

The Windsor container system under developpement

New in GreenPepper .Net 1.3
Import
GreenPepper.WindsorCastle.Fixtures


A Castle basic Xml configuration file
<configuration>
    <components>
        <component id="Windsor.HelloWorld" type="GreenPepper.WindsorCastle.Fixtures.WindsorHelloWorld, GreenPepper.Extensions">
            <parameters>
            	<injectedConstructor>hello constructor</injectedConstructor>
                <injectedProperty>hello property</injectedProperty>
            </parameters>
        </component>

        <component id="Windsor.component1" 
        	type="GreenPepper.WindsorCastle.Fixtures.MyComponent1, GreenPepper.Extensions">
        </component>
        
        <component id="Windsor.component2"
        	type="GreenPepper.WindsorCastle.Fixtures.MyComponent2, GreenPepper.Extensions">
        </component>
        
        <component id="Windsor.AutoWired" type="GreenPepper.WindsorCastle.Fixtures.WindsorAutoWiredFixture, GreenPepper.Extensions" />
    </components>
</configuration>


The Windsor system under development use WindsorContainer to resolve fixtures like in this next example :
do with windsor hello world
check injected constructor hello constructor
check injected property hello property
end
The Castle system under development can use auto-wiring system provided by Windsor:
do with Windsor auto wired fixture
check getComponent1().ToString() Hello from component 1 class
check getComponent2().ToString() Hello from component 2 class
end

If your fixture is not defined in xml configuration file, the system under development will try to load the fixture and to inject it data needed (if this data are defined in xml configuration file)

do with standard fixture
check getComponent1().ToString() Hello from component 1 class
check getComponent2().ToString() Hello from component 2 class


How to use Windsor system under development :
Begin Info
  • Requirements :
  1. You must add GreenPepper.Extensions.Castle.Windsor assembly in your configuration assemblies
  2. You must notify GreenPepper Core to use Windsor system under development : GreenPepper.WindsorCastle.WindsorSystemUnderDevelopment

(You can find more about system under development configuration here : Using a custom SystemUnderDevelopment)

  • If you use a Windsor xml configuration file :
    Just add the path to your Windsor configuration file in the system under development arguments
End Info

DEMONSTRATION LICENSE - This Confluence site is for demonstration purposes only. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.3 Build:#705 Mar 21, 2007) - Bug/feature request - Contact Administrators