tag:blogger.com,1999:blog-2486313360029846926.post4949619539569916265..comments2024-02-17T08:26:23.547+00:00Comments on DevIL's Diary: Merry XMLless! CodeConfig for Spring.NETErich Eichingerhttp://www.blogger.com/profile/01777569034256321263noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-2486313360029846926.post-78880621863924063822011-03-13T20:15:30.835+00:002011-03-13T20:15:30.835+00:00I would like to introduce another solution to code...I would like to introduce another solution to code base configuration for spring.net. This library takes slightly different approach than this one proposed.<br /><br />https://github.com/thenapoleon/Fluent-API-for-Spring.Net/wiki/Fluent-Spring-Configuration-for-.Net<br /><br />This library will soon contain convention based configuration too which will extend the existing auto wiring from spring.Yoann Esnaudhttps://www.blogger.com/profile/10288208834626071239noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-89077069407071658372010-11-29T06:03:43.963+00:002010-11-29T06:03:43.963+00:00I'd like to propose 2 changes:
1. Allow overri...I'd like to propose 2 changes:<br />1. Allow overriding object defined in parent context (see TODO in ConfigurationProcessor line 153);<br />2. ServiceLocator GetObject without name should search for objects defined in parent context as the one with name does.<br /><br />Here is the patch file for the 1st change if you need it:<br /><br />Index: src/Spring/Spring.Config/Config/Process/ConfigurationProcessor.cs<br />===================================================================<br />--- src/Spring/Spring.Config/Config/Process/ConfigurationProcessor.cs (revision 8)<br />+++ src/Spring/Spring.Config/Config/Process/ConfigurationProcessor.cs (working copy)<br />@@ -144,23 +144,15 @@<br /> DefinitionAttribute definitionAttribute = IsObjectDefinitionCandidate(cfgAttribute, method);<br /> if (definitionAttribute != null)<br /> {<br />- string objectName = string.Empty;<br />- objectName = definitionAttribute.Name;<br />+ string objectName = definitionAttribute.Name;<br /> if (string.IsNullOrEmpty(objectName)) objectName = objectNamingStrategy.GetObjectName(method);<br /> <br />- if (!methodsSeen.Contains(objectName))<br />+ if (!methodsSeen.Contains(objectName)<br />+ && owningObjectFactory.GetObjectDefinition(objectName, false) != null)<br /> {<br />- //TODO avoid check in parent object factories.<br />- if (owningObjectFactory.ContainsObjectDefinition(objectName))<br />- {<br />- if (!definitionAttribute.AllowOverridding)<br />- {<br />- throw new InvalidOperationException("An object named " + objectName +<br />- "already exists. Consider using [ObjectDefinition(AllowOverriding=true)]");<br />- }<br />- return;<br />- }<br />- <br />+ if (definitionAttribute.AllowOverridding) return;<br />+ throw new InvalidOperationException("An object named " + objectName +<br />+ "already exists. Consider using [ObjectDefinition(AllowOverriding=true)]");<br /> }<br /> methodsSeen.Add(objectName);<br /> GenerateObjectDefinitionFromObjectCreationMethod(cfgAttribute, configurationObjectName, objectName, method, definitionAttribute);Unknownhttps://www.blogger.com/profile/09605765307876902539noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-12104905355499532052010-10-28T22:22:56.022+01:002010-10-28T22:22:56.022+01:00I think I've found the bug in the ProcessUtils...I think I've found the bug in the ProcessUtils.cs:<br /><br /> public static void CopyAttributes(string objectName, ConfigurationAttribute configurationAttribute, DefinitionAttribute definitionAttribute, RootObjectDefinition rod, IConfigurableListableObjectFactory objectFactory)<br /> {<br /> if (definitionAttribute.Scope == Scope.Singleton)<br /> {<br /> rod.IsSingleton = true;<br /> } else<br /> {<br /> rod.IsAbstract = false;<br /> }<br /><br /><br />After appending the follow piece of code to above the problem is gone:<br /><br /> if (definitionAttribute.Scope == Scope.Prototype)<br /> {<br /> rod.IsSingleton = false;<br /> }Joseph Lamhttps://www.blogger.com/profile/09103065449779381131noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-20500754486644215562010-10-28T21:13:35.243+01:002010-10-28T21:13:35.243+01:00I seem to run into a bug...objects defined with th...I seem to run into a bug...objects defined with the 'Prototype' scope are being treated by Spring as Singletons.Joseph Lamhttps://www.blogger.com/profile/09103065449779381131noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-18390801673588391442010-07-02T09:05:47.766+01:002010-07-02T09:05:47.766+01:00Right... I must be doing something stupid, using s...Right... I must be doing something stupid, using svn, I am trying to download the src from the url given above, but everytime I get "cannot connect to https://src.springframework.org"<br /><br />the svn command I use is 'svn checkout https://src.springframework.org/svn/se-config-net/trunk -r HEAD'<br /><br />help?Yoann Esnaudhttps://www.blogger.com/profile/10288208834626071239noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-18108535493619919582010-05-11T09:28:54.267+01:002010-05-11T09:28:54.267+01:00I'm Sorry
can you help me!
i have error:
No c...I'm Sorry<br />can you help me!<br />i have error:<br /><b><br />No context registered. Use the 'RegisterContext' method or the 'spring/context' section from your configuration file.</b><br />Video:http://www.youtube.com/watch?v=LKBHVXFfETo<br />thanksUnknownhttps://www.blogger.com/profile/11327792360408240971noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-48805963993466826822010-03-21T23:10:26.098+00:002010-03-21T23:10:26.098+00:00Hi Erich. I downloaded your code (rev 45) and star...Hi Erich. I downloaded your code (rev 45) and started playing with an ASP.NET MVC application. When configuring the Controllers I have to include them and in another phase Override them for SetSingleton(false). I think is too verbose because I have to write two times the same selector. There is a way to do the two things in the Include. Maybe an IncludeAndConfigure( t, cfg ) ?<br /><br />Thanks in advance.Hernan Parrahttps://www.blogger.com/profile/12432376017398680542noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-67698103386586820692010-03-16T02:36:25.468+00:002010-03-16T02:36:25.468+00:00how about auto scan feature for all assembly in Ba...how about auto scan feature for all assembly in BaseDirectory. <br /><br />Scan for all assembly and get type that marked with [Repository] and [Service] attribute?Unknownhttps://www.blogger.com/profile/05108079093809798628noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-82726156151767105172010-02-27T22:11:34.532+00:002010-02-27T22:11:34.532+00:00Hi Erich
Ok - I will look into the TypeNamingConv...Hi Erich<br /><br />Ok - I will look into the TypeNamingConvention class to see if it fits the bill.<br /><br />I would be grateful if you could let me know if anything changes so that i can take the latest cut and place it into SAF.<br /><br />Cheers<br />MarkUnknownhttps://www.blogger.com/profile/14444446012060939265noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-27505438285067688482010-02-21T22:50:22.421+00:002010-02-21T22:50:22.421+00:00@Mark, for the moment it will stay as an independe...@Mark, for the moment it will stay as an independent project. We will release the first milstone within the next weeks.<br />Regarding your naming question: Checkout the TypeNamingConvention class - if you have specific needs how to name your objects this might be a good start!<br /><br />Keep the feedback coming! I am very curious to hear experiences from the fields!<br /><br />hth,<br />ErichErich Eichingerhttps://www.blogger.com/profile/01777569034256321263noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-7217762285664956872010-02-21T21:45:33.609+00:002010-02-21T21:45:33.609+00:00Hey - I like it!
We are using Spring extensively ...Hey - I like it!<br /><br />We are using Spring extensively for the SharePoint Action Framework (SAF) http://saf.codeplex.com. <br /><br />We've been looking into developing a non-xml way to create our containers for a while now. This looks as though it could be the ticket.<br /><br />Couple of questions ...<br /><br />How do i give my object defs an "Id". We have a few methods that do a "GetObject(string name)" and I can't see how to assign one. <br /><br />Do you think this will be rolled into the vNext of Spring ? If so, when ? just wondering whether to wait, or go with your source...<br /><br />Many thanks and great work MarkUnknownhttps://www.blogger.com/profile/14444446012060939265noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-88299329232955661902009-12-18T04:58:20.703+00:002009-12-18T04:58:20.703+00:00Simply and great, very good and original job.Simply and great, very good and original job.Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-15276198040690124212009-12-17T22:25:21.038+00:002009-12-17T22:25:21.038+00:00Great!
What about an MarkerInterface instead of ...Great! <br /><br />What about an MarkerInterface instead of Attributes?Blog: Robert-Mhttps://www.blogger.com/profile/01480361475635121923noreply@blogger.comtag:blogger.com,1999:blog-2486313360029846926.post-91124516081434441932009-12-17T16:09:39.283+00:002009-12-17T16:09:39.283+00:00The Spring 3.0 references docs on this functionali...The Spring 3.0 references docs on this functionality are also a good place to look for general info and probably will be closer to the direction of Spring.NET's CodeConfig.<br /><br />http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html#beans-javaMark Pollackhttps://www.blogger.com/profile/03475995335411875143noreply@blogger.com