Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hallo, is the following possible with spring.Net.
I want to configure either through the property setter or constructor, injection with spring.
Would I always have to access the object (defined in my xml) through the "context" class of spring or can I somehow instantiate the class without any code.

XML


XML
<configuration>
  <configSections>
    <sectionGroup name="spring">
      <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
      <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
    </sectionGroup>
  </configSections>

  <spring>
    <context>
      <resource uri="config://spring/objects"/>
    </context>
    <objects xmlns="http://www.springframework.net">
      <object id="foo" type="SpringIoC.Test.GlobalVariables, SpringIoC.Test">
        <constructor-arg ref="anotherExampleObject"/>>
      </object>
      <object id="anotherExampleObject" type="SpringIoC.Implementor.HalloWorld, SpringIoC.Implementor"/>
    </objects>
  </spring>
</configuration>


Maybe with static class?
Posted
Comments
Dave Kreskowiak 28-Aug-13 9:30am    
Don't you think it would be better to ask your question in a forum dedicated to Spring.NET?? Where are you most likely going to find the highest concentration of Spring.NET users??

Maybe at http://forum.springframework.net/forum.php?s=0a39163bcf67d0e263e4779a3f24d250

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900