From: <jer...@us...> - 2008-07-10 20:49:48
|
Revision: 126 http://structuremap.svn.sourceforge.net/structuremap/?rev=126&view=rev Author: jeremydmiller Date: 2008-07-10 13:49:46 -0700 (Thu, 10 Jul 2008) Log Message: ----------- fixing some crap with profile manager, improvements to diagnostics, little fixes Modified Paths: -------------- trunk/Source/HTML/HTML.csproj trunk/Source/HTML/InjectingServicesAtRuntime.htm trunk/Source/StructureMap/Configuration/DSL/Registry.cs trunk/Source/StructureMap/Container.cs trunk/Source/StructureMap/Diagnostics/TextReportWriter.cs trunk/Source/StructureMap/Diagnostics/ValidationBuildSession.cs trunk/Source/StructureMap/Diagnostics/WhatDoIHaveWriter.cs trunk/Source/StructureMap/ExplicitArgsExpression.cs trunk/Source/StructureMap/Graph/AssemblyScanner.cs trunk/Source/StructureMap/Graph/Constructor.cs trunk/Source/StructureMap/Graph/ITypeScanner.cs trunk/Source/StructureMap/Graph/Plugin.cs trunk/Source/StructureMap/Graph/PluginFamily.cs trunk/Source/StructureMap/Graph/PluginGraph.cs trunk/Source/StructureMap/IContainer.cs trunk/Source/StructureMap/IInstanceFactory.cs trunk/Source/StructureMap/InstanceFactory.cs trunk/Source/StructureMap/ObjectFactory.cs trunk/Source/StructureMap/Pipeline/BuildPolicy.cs trunk/Source/StructureMap/Pipeline/CacheInterceptor.cs trunk/Source/StructureMap/Pipeline/ExplicitArguments.cs trunk/Source/StructureMap/Pipeline/HttpContextBuildPolicy.cs trunk/Source/StructureMap/Pipeline/Instance.cs trunk/Source/StructureMap/Pipeline/LiteralInstance.cs trunk/Source/StructureMap/Pipeline/Profile.cs trunk/Source/StructureMap/Pipeline/ProfileManager.cs trunk/Source/StructureMap/PipelineGraph.cs trunk/Source/StructureMap/Properties/AssemblyInfo.cs trunk/Source/StructureMap/StructureMap.csproj trunk/Source/StructureMap/StructureMapConfiguration.cs trunk/Source/StructureMap.DataAccess/IDatabaseEngine.cs trunk/Source/StructureMap.DataAccess/StructureMap.DataAccess.csproj trunk/Source/StructureMap.Testing/Attributes/PluginFamilyAttributeTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/AddInstanceTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/RegistryTester.cs trunk/Source/StructureMap.Testing/DataAccess/CommandCollectionTester.cs trunk/Source/StructureMap.Testing/DataAccess/CommandFactoryTester.cs trunk/Source/StructureMap.Testing/DataAccess/DataSessionTester.cs trunk/Source/StructureMap.Testing/DataAccess/ExecutionStates/AutoCommitExecutionStateTester.cs trunk/Source/StructureMap.Testing/DataAccess/ExecutionStates/TransactionalExecutionStateTester.cs trunk/Source/StructureMap.Testing/DataAccess/Parameterization/ParameterTemplateTester.cs trunk/Source/StructureMap.Testing/DataAccess/ReaderSourceCollectionTester.cs trunk/Source/StructureMap.Testing/Examples.cs trunk/Source/StructureMap.Testing/Graph/ContainerTester.cs trunk/Source/StructureMap.Testing/Graph/DefaultConventionScanningTester.cs trunk/Source/StructureMap.Testing/Graph/ExplicitArgumentTester.cs trunk/Source/StructureMap.Testing/Pipeline/ProfileManagerMergeTester.cs trunk/Source/StructureMap.Testing/Pipeline/ProfileManagerTester.cs trunk/Source/StructureMap.Testing/PipelineGraphTester.cs trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj trunk/Source/StructureMap.Testing/TestData/AttributeNormalized.xml trunk/Source/StructureMap.Testing/TestData/DefaultInstance.xml trunk/Source/StructureMap.Testing.Widget/StructureMap.Testing.Widget.csproj trunk/Source/StructureMap.Testing.Widget2/StructureMap.Testing.Widget2.csproj trunk/Source/StructureMap.Testing.Widget3/StructureMap.Testing.Widget3.csproj trunk/Source/StructureMap.Testing.Widget4/StructureMap.Testing.Widget4.csproj trunk/Source/StructureMap.Testing.Widget5/StructureMap.Testing.Widget5.csproj trunk/Source/StructureMap.sln Added Paths: ----------- trunk/Source/StructureMap.DataAccess/structuremap.snk trunk/Source/StructureMap.Testing/Properties/ trunk/Source/StructureMap.Testing/Properties/Settings.Designer.cs trunk/Source/StructureMap.Testing/Properties/Settings.settings trunk/Source/StructureMap.Testing.Widget/structuremap.snk trunk/Source/StructureMap.Testing.Widget2/structuremap.snk trunk/Source/StructureMap.Testing.Widget3/structuremap.snk trunk/Source/StructureMap.Testing.Widget4/structuremap.snk trunk/Source/StructureMap.Testing.Widget5/structuremap.snk Removed Paths: ------------- trunk/Source/HTML/Concepts.htm Deleted: trunk/Source/HTML/Concepts.htm =================================================================== --- trunk/Source/HTML/Concepts.htm 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/HTML/Concepts.htm 2008-07-10 20:49:46 UTC (rev 126) @@ -1,49 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<html> - <head> - <title></title> - </head> - <body> - <h3>Patterns and Concepts</h3> - <p> - Object oriented systems are composed of a myriad array of objects communicating - by sending messages to exposed interfaces. To a large degree, the qualities of - an OO design are determined by the structure, organization, and responsibility - assignments of the objects in a system. The qualities of a system most - affected by structure are flexibility, extensibility, maintainability, and - testability. Applications usually meet their demise when the system is - determined to be too difficult or costly to change. The symptoms of a dying - application are a loss of clearly defined structure, an unclear division - of responsibilities in the code, and difficulty testing and troubleshooting the - application. </p> - <p> - Over the years a series of rules and principles have been discovered and - developed to describe well-structured systems. Possibly most important is - <em>Separation of Concerns</em> – pulling separate aspects of the system like - persistence, security, or business logic into separate classes and packages. - Another key concept is the combination of highly cohesive classes in a loosely - coupled structure. The more highly coupled two components of a system are, the - more difficult the system is to maintain, test, and reuse. A class should have a - cohesive set of responsibilities in a narrow domain. In other words, - simpleton classes that do only one thing are much easier to code and test than - <em>God</em> classes that take on far too many unrelated responsibilities. </p> - <p> </p> - <h4>Separation of Concerns</h4> - <h4>Services and Dependencies</h4> - <h4>Dependency Injection</h4> - <h4>Container</h4> - <h4>Service Locator</h4> - <h3>StructureMap Terms</h3> - <h4>PluginType</h4> - <p>Object Oriented Design</p> - <h4>Auto Wiring</h4> - <p>Every "real" IoC container supports the concept of "Auto Wiring." Auto - Wiring simply means that StructureMap can figure out dependency chains for you.</p> - <h4>Instance</h4> - <h4>Scoping</h4> - <h4>PluginFamily</h4> - <h4>Profile</h4> - <h4>Interceptor</h4> - <h4>PostProcessor</h4> - </body> -</html> \ No newline at end of file Modified: trunk/Source/HTML/HTML.csproj =================================================================== --- trunk/Source/HTML/HTML.csproj 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/HTML/HTML.csproj 2008-07-10 20:49:46 UTC (rev 126) @@ -62,7 +62,7 @@ <Content Include="BestPractices.htm" /> <Content Include="ChangingDefaultsAtRuntime.htm" /> <Content Include="CompositeConfiguration.htm" /> - <Content Include="Concepts.htm" /> + <Content Include="Glossary.htm" /> <Content Include="ConcreteTypes.htm" /> <Content Include="ConfigurationArchitecture.htm" /> <Content Include="ConfiguringStructureMap.htm" /> Modified: trunk/Source/HTML/InjectingServicesAtRuntime.htm =================================================================== --- trunk/Source/HTML/InjectingServicesAtRuntime.htm 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/HTML/InjectingServicesAtRuntime.htm 2008-07-10 20:49:46 UTC (rev 126) @@ -4,8 +4,10 @@ <title>Injecting Services or Mocks at Runtime</title> </head> <body> - <h1>Injecting Services, Mocks, and Stubs at Runtime</h1> + <h1>Injecting Modules, Services, Mocks, and Stubs at Runtime</h1> <p>In the beginning (2003), there was attributes and Xml configuration, and I called it good. + Look Ma! I can radically change the behavior of the code without + recompiling, isn't that a marvelous thing? Then we started to use StructureMap on a real project and quickly realized that it would be very useful if we could override some services with mock objects in our unit tests. In later projects I've run into scenarios where it would @@ -21,37 +23,161 @@ normal configuration).</p> <h4>Injecting a Service at Runtime</h4> - <p>In my desktop applications the main form implements some sort of + <p>In my desktop applications the main form usually implements some sort of IApplicationShell interface. I've found it valuable to place the main form itself into StructureMap, as well as several child controls of the main form as well so that various Controllers, Presenters, and Commands can interact with - parts of the main shell. I probably could build the ApplicationShell + parts of the main shell without tight coupling. I probably could build the ApplicationShell itself inside of StructureMap, but the child controls like (I'm making this up) IQueryToolBar or IExplorerPane are easiest to create as part of the - ApplicationShell and loaded later.</p> + ApplicationShell and loaded into StructureMap later.</p> <!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 ApplicationShell\cf0 : \cf4 Form\cf0 , \cf4 IApplicationShell\par ??\cf0 \{\par ?? \par ?? \}} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"> <p style="margin: 0px;"> + </p> +<!-- +{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 ApplicationShell\cf0 : \cf4 Form\cf0 , \cf4 IApplicationShell\par ??\cf0 \{\par ?? \cf3 public\cf0 \cf4 IQueryToolBar\cf0 QueryToolBar\par ?? \{\par ?? \cf3 get\par ??\cf0 \{\par ?? \cf3 return\cf0 \cf3 null\cf0 ;\par ?? \}\par ?? \}\par ??\par ?? \cf3 public\cf0 \cf4 IExplorerPane\cf0 ExplorerPane\par ?? \{\par ?? \cf3 get\par ??\cf0 \{\par ?? \cf3 return\cf0 \cf3 null\cf0 ;\par ?? \}\par ?? \}\par ?? \}} +--> + <div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"> + <p style="margin: 0px;"> <span style="color: blue;">public</span> <span style="color: blue;">class</span> - <span style="color: #2b91af;">ApplicationShell</span> : - <span style="color: #2b91af;">Form</span>, <span style="color: #2b91af;"> - IApplicationShell</span></p> - <p style="margin: 0px;"> + <span style="color: #2b91af;">ApplicationShell</span> : + <span style="color: #2b91af;">Form</span>, <span style="color: #2b91af;"> + IApplicationShell</span></p> + <p style="margin: 0px;"> {</p> - <p style="margin: 0px;"> - </p> - <p style="margin: 0px;"> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> + <span style="color: #2b91af;">IQueryToolBar</span> QueryToolBar...</p> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> + <span style="color: #2b91af;">IExplorerPane</span> ExplorerPane...</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> }</p> - </div> + </div> <!--EndFragment--> -<p> </p> +</div> +<!--EndFragment--> +<p>Easy enough. The main shell has some controls on it. Now, we may want + a centralized class to govern the behavior of just the query tool bar along the + top of the main form. That class obviously needs to find the IQueryToolBar + on the main form, but I need a clean way of connecting the IQueryToolBar to this + new QueryController class.</p> +<!-- +{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 QueryController\par ??\cf0 \{\par ?? \cf3 private\cf0 \cf4 IQueryToolBar\cf0 _toolBar;\par ??\par ?? \cf3 public\cf0 QueryController(\cf4 IQueryToolBar\cf0 toolBar)\par ?? \{\par ?? _toolBar = toolBar;\par ?? \}\par ?? \}} +--> +<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> <span style="color: blue;"> + class</span> <span style="color: #2b91af;">QueryController</span></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + <span style="color: blue;">private</span> + <span style="color: #2b91af;">IQueryToolBar</span> _toolBar;</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> + QueryController(<span style="color: #2b91af;">IQueryToolBar</span> toolBar)</p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + _toolBar = toolBar;</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + }</p> +</div> +<!--EndFragment--> +<p>StructureMap is going to build up the QueryController, but it doesn't help to + inject in a new IQueryToolBar that isn't visible anywhere in the application. + We need to get to exactly the right instance of that control. So let's use + the new Inject<T>(T instance) method on ObjectFactory to register the child + controls from the main form.</p> +<!-- +{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green128\blue0;\red43\green145\blue175;\red0\green0\blue255;}??\fs20 \cf3 // Familiar stuff for the average WinForms or WPF developer\par ??\cf0 \cf3 // Create the main form\par ??\cf0 \cf4 ApplicationShell\cf0 shell = \cf5 new\cf0 \cf4 ApplicationShell\cf0 ();\par ??\par ?? \cf3 // Put the main form, and some of its children into StructureMap\par ??\cf0 \cf3 // where other Controllers and Commands can get to them\par ??\cf0 \cf3 // without being coupled to the main form\par ??\cf0 \cf4 ObjectFactory\cf0 .Inject<\cf4 IApplicationShell\cf0 >(shell);\par ?? \cf4 ObjectFactory\cf0 .Inject<\cf4 IQueryToolBar\cf0 >(shell.QueryToolBar);\par ?? \cf4 ObjectFactory\cf0 .Inject<\cf4 IExplorerPane\cf0 >(shell.ExplorerPane);\par ??\par ??\par ?? \cf4 Application\cf0 .Run(shell);} +--> +<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"> + <p style="margin: 0px;"> + + <span style="color: green;">// Familiar stuff for the average WinForms or WPF + developer</span></p> + <p style="margin: 0px;"> + + <span style="color: green;">// Create the main form</span></p> + <p style="margin: 0px;"> + + <span style="color: #2b91af;">ApplicationShell</span> shell = + <span style="color: blue;">new</span> <span style="color: #2b91af;"> + ApplicationShell</span>();</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + + <span style="color: green;">// Put the main form, and some of its children into + StructureMap</span></p> + <p style="margin: 0px;"> + + <span style="color: green;">// where other Controllers and Commands can get to + them</span></p> + <p style="margin: 0px;"> + + <span style="color: green;">// without being coupled to the main form</span></p> + <p style="margin: 0px;"> + + <span style="color: #2b91af;">ObjectFactory</span>.Inject<<span + style="color: #2b91af;">IApplicationShell</span>>(shell);</p> + <p style="margin: 0px;"> + + <span style="color: #2b91af;">ObjectFactory</span>.Inject<<span + style="color: #2b91af;">IQueryToolBar</span>>(shell.QueryToolBar);</p> + <p style="margin: 0px;"> + + <span style="color: #2b91af;">ObjectFactory</span>.Inject<<span + style="color: #2b91af;">IExplorerPane</span>>(shell.ExplorerPane);</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + + <span style="color: #2b91af;">Application</span>.Run(shell);</p> +</div> +<!--EndFragment--> +<p>I've used this exact strategy on three applications now to great s.Run(shell);</p> +</div> +<!--EndFragment--> +<p>Now, a call to ObjectFactory.GetInstance<QueryController>() will poke the + IQueryToolBar instance we registered above into the constructor of the new + QueryController object. Remember, one of the primary usages of + StructureMap is simply to get the right service dependencies and metadata to the + right concrete classes so you can concentrate on doing QueryController stuff in + the QueryController class instead of bootstrapping all the stuff it needs.</p> +<p>I've used this exact strategy on three applications now to great success. + The previous design had a lot of "thisThing.ThatThing.QueryToolBar" properties + just to get access to the child controls on the main form. It was + devolving into spaghetti code before I adopted the strategy above.</p> +<p>The ObjectFactory.Inject<T>(T instance) method is identical to the older + ObjectFactory.InjectStub<T>(T stub) method. I've marked the older method + as deprecated because I think the name is misleading. </p> +<p>Use this strategy for any type of service or component that you need to inject + into other services, but isn't convenient or possible to build through + StructureMap itself.</p> <h4>Injecting a Mock or a Stub at Runtime</h4> + <p>On its maiden cruise in 2004, my team quickly realized that we needed a way to +On its maiden cruise in 2004, my team quickly realized that we needed a way to + make StructureMap deliver up mock objects in unit tests. It obviously + isn't efficient to muck with an Xml file for each and every unit test that + requires this function, so we wanted a way to temporarily load ObjectFactory up + with a mock object in place of its normal behavior for a given type.</p> <h4></h4> <h4></h4> <h4></h4> <h4></h4> - <h4></h4> </body> </html> \ No newline at end of file Modified: trunk/Source/StructureMap/Configuration/DSL/Registry.cs =================================================================== --- trunk/Source/StructureMap/Configuration/DSL/Registry.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Configuration/DSL/Registry.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -31,12 +31,16 @@ internal void ConfigurePluginGraph(PluginGraph graph) { + if (graph.Registries.Contains(this)) return; + graph.Log.StartSource("Registry: " + TypePath.GetAssemblyQualifiedName(GetType())); foreach (Action<PluginGraph> action in _actions) { action(graph); } + + graph.Registries.Add(this); } @@ -193,5 +197,28 @@ { _actions.Add(graph => graph.FindFamily(typeof (PLUGINTYPE)).AddInstance(instance)); } + + public bool Equals(Registry obj) + { + if (ReferenceEquals(null, obj)) return false; + return GetType().Equals(obj.GetType()); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + + if (obj is Registry) return false; + + + if (obj.GetType() != typeof (Registry)) return false; + return Equals((Registry) obj); + } + + public override int GetHashCode() + { + return 0; + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Container.cs =================================================================== --- trunk/Source/StructureMap/Container.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Container.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -82,10 +82,19 @@ { Instance defaultInstance = _pipelineGraph.GetDefault(typeof (PLUGINTYPE)); - ExplicitInstance<PLUGINTYPE> instance = new ExplicitInstance<PLUGINTYPE>(args, defaultInstance); + ExplicitInstance instance = new ExplicitInstance(typeof(PLUGINTYPE), args, defaultInstance); return GetInstance<PLUGINTYPE>(instance); } + public object GetInstance(Type type, ExplicitArguments args) + { + Instance defaultInstance = _pipelineGraph.GetDefault(type); + + Instance instance = new ExplicitInstance(type, args, defaultInstance); + + return GetInstance(type, instance); + } + public void Inject<PLUGINTYPE>(PLUGINTYPE instance) { _pipelineGraph.Inject(instance); @@ -288,6 +297,8 @@ } } + + #endregion private IBuildSession withNewSession() Modified: trunk/Source/StructureMap/Diagnostics/TextReportWriter.cs =================================================================== --- trunk/Source/StructureMap/Diagnostics/TextReportWriter.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Diagnostics/TextReportWriter.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -26,6 +26,11 @@ _lines.Add(new TextLine(contents)); } + public void AddContent(string contents) + { + _lines.Add(new PlainLine(contents)); + } + public void Write(StringWriter writer) { CharacterWidth[] widths = CharacterWidth.For(_columnCount); @@ -67,5 +72,27 @@ { Debug.WriteLine(Write()); } + + } + + internal class PlainLine : Line + { + public string Contents { get; set; } + + public PlainLine(string contents) + { + Contents = contents; + } + + public void OverwriteCounts(CharacterWidth[] widths) + { + // no-op + } + + public void Write(TextWriter writer, CharacterWidth[] widths) + { + writer.WriteLine(Contents); + } + } } Modified: trunk/Source/StructureMap/Diagnostics/ValidationBuildSession.cs =================================================================== --- trunk/Source/StructureMap/Diagnostics/ValidationBuildSession.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Diagnostics/ValidationBuildSession.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -86,7 +86,7 @@ - void IPipelineGraphVisitor.PluginType(Type pluginType, Instance defaultInstance) + void IPipelineGraphVisitor.PluginType(Type pluginType, Instance defaultInstance, IBuildPolicy policy) { // don't care } Modified: trunk/Source/StructureMap/Diagnostics/WhatDoIHaveWriter.cs =================================================================== --- trunk/Source/StructureMap/Diagnostics/WhatDoIHaveWriter.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Diagnostics/WhatDoIHaveWriter.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -61,7 +61,7 @@ writer.WriteLine(); } - void IPipelineGraphVisitor.PluginType(Type pluginType, Instance defaultInstance) + void IPipelineGraphVisitor.PluginType(Type pluginType, Instance defaultInstance, IBuildPolicy policy) { _writer.AddDivider('-'); string[] contents = new string[]{TypePath.GetAssemblyQualifiedName(pluginType), string.Empty, string.Empty}; @@ -73,6 +73,8 @@ } _writer.AddText(contents); + + _writer.AddContent("Built by: " + policy.ToString()); } private void setContents(string[] contents, Instance instance) Modified: trunk/Source/StructureMap/ExplicitArgsExpression.cs =================================================================== --- trunk/Source/StructureMap/ExplicitArgsExpression.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/ExplicitArgsExpression.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -1,3 +1,4 @@ +using System; using StructureMap.Pipeline; namespace StructureMap @@ -60,5 +61,15 @@ { return _manager.GetInstance<T>(_args); } + + /// <summary> + /// Create an instance using the explicit arguments + /// </summary> + /// <param name="type"></param> + /// <returns></returns> + public object GetInstance(Type type) + { + return _manager.GetInstance(type, _args); + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Graph/AssemblyScanner.cs =================================================================== --- trunk/Source/StructureMap/Graph/AssemblyScanner.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Graph/AssemblyScanner.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -29,6 +29,14 @@ { if (!Registry.IsPublicRegistry(type)) return; + foreach (var previous in pluginGraph.Registries) + { + if (previous.GetType().Equals(type)) + { + return; + } + } + Registry registry = (Registry) Activator.CreateInstance(type); registry.ConfigurePluginGraph(pluginGraph); }); Modified: trunk/Source/StructureMap/Graph/Constructor.cs =================================================================== --- trunk/Source/StructureMap/Graph/Constructor.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Graph/Constructor.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -43,6 +43,11 @@ return returnValue; } + public static bool HasConstructors(Type pluggedType) + { + return GetGreediestConstructor(pluggedType) != null; + } + public static ConstructorInfo GetGreediestConstructor(Type pluggedType) { ConstructorInfo returnValue = null; @@ -112,5 +117,10 @@ { return _ctor.GetParameters().Length > 0; } + + public bool IsValid() + { + return _ctor != null; + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Graph/ITypeScanner.cs =================================================================== --- trunk/Source/StructureMap/Graph/ITypeScanner.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Graph/ITypeScanner.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text; using StructureMap.Configuration.DSL; +using StructureMap.Pipeline; namespace StructureMap.Graph { @@ -19,7 +20,7 @@ Type pluginType = FindPluginType(type); if (pluginType != null) { - registry.ForRequestedType(pluginType).TheDefaultIsConcreteType(type); + registry.ForRequestedType(pluginType).AddInstance(new ConfiguredInstance(type)); } } Modified: trunk/Source/StructureMap/Graph/Plugin.cs =================================================================== --- trunk/Source/StructureMap/Graph/Plugin.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Graph/Plugin.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -123,5 +123,17 @@ { _setters.Visit(arguments); } + + public bool IsValid() + { + return _constructor.IsValid(); + } + + public static Plugin CreateForConcreteType(Type type) + { + if (!Constructor.HasConstructors(type)) return null; + + return new Plugin(type, DEFAULT); + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Graph/PluginFamily.cs =================================================================== --- trunk/Source/StructureMap/Graph/PluginFamily.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Graph/PluginFamily.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -44,8 +44,11 @@ if (IsConcrete(pluginType)) { - Plugin plugin = new Plugin(pluginType, Plugin.DEFAULT); - Plugins.Add(plugin); + Plugin plugin = Plugin.CreateForConcreteType(pluginType); + if (plugin != null) + { + Plugins.Add(plugin); + } } } Modified: trunk/Source/StructureMap/Graph/PluginGraph.cs =================================================================== --- trunk/Source/StructureMap/Graph/PluginGraph.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Graph/PluginGraph.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using System.Reflection; +using StructureMap.Configuration.DSL; using StructureMap.Diagnostics; using StructureMap.Interceptors; using StructureMap.Pipeline; @@ -21,6 +23,8 @@ private readonly ProfileManager _profileManager = new ProfileManager(); private readonly bool _useExternalRegistries = true; private bool _sealed = false; + private List<Registry> _registries = new List<Registry>(); + /// <summary> /// Default constructor @@ -37,6 +41,11 @@ _useExternalRegistries = useExternalRegistries; } + public List<Registry> Registries + { + get { return _registries; } + } + public AssemblyScanner Assemblies { get { return _assemblies; } Modified: trunk/Source/StructureMap/IContainer.cs =================================================================== --- trunk/Source/StructureMap/IContainer.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/IContainer.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -66,5 +66,6 @@ ExplicitArgsExpression With<T>(T arg); IExplicitProperty With(string argName); void AssertConfigurationIsValid(); + object GetInstance(Type type, ExplicitArguments args); } } \ No newline at end of file Modified: trunk/Source/StructureMap/IInstanceFactory.cs =================================================================== --- trunk/Source/StructureMap/IInstanceFactory.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/IInstanceFactory.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -23,5 +23,6 @@ InstanceBuilder FindBuilderByConcreteKey(string concreteKey); void ForEachInstance(Action<Instance> action); void ImportFrom(PluginFamily family); + void AcceptVisitor(IPipelineGraphVisitor visitor, Instance defaultInstance); } } \ No newline at end of file Modified: trunk/Source/StructureMap/InstanceFactory.cs =================================================================== --- trunk/Source/StructureMap/InstanceFactory.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/InstanceFactory.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -144,5 +144,11 @@ _instanceBuilders.Add(family.Plugins); family.EachInstance(instance => _instances.Fill(instance.Name, instance)); } + + public void AcceptVisitor(IPipelineGraphVisitor visitor, Instance defaultInstance) + { + visitor.PluginType(PluginType, defaultInstance, _policy); + ForEachInstance(i => visitor.Instance(PluginType, i)); + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/ObjectFactory.cs =================================================================== --- trunk/Source/StructureMap/ObjectFactory.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/ObjectFactory.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -53,7 +53,7 @@ /// <returns></returns> public static object FillDependencies(Type type) { - return manager.FillDependencies(type); + return container.FillDependencies(type); } /// <summary> @@ -64,7 +64,7 @@ /// <returns></returns> public static T FillDependencies<T>() { - return (T) manager.FillDependencies(typeof (T)); + return (T) container.FillDependencies(typeof (T)); } [Obsolete("Please use Inject(Type, object) instead.")] @@ -75,7 +75,7 @@ public static void Inject(Type pluginType, object instance) { - manager.Inject(pluginType, instance); + container.Inject(pluginType, instance); } [Obsolete("Please use Inject() instead.")] @@ -86,12 +86,12 @@ public static void Inject<PLUGINTYPE>(PLUGINTYPE instance) { - manager.Inject<PLUGINTYPE>(instance); + container.Inject<PLUGINTYPE>(instance); } public static void Inject<PLUGINTYPE>(string name, PLUGINTYPE instance) { - manager.Inject<PLUGINTYPE>(name, instance); + container.Inject<PLUGINTYPE>(name, instance); } [Obsolete("Please use Inject<PLUGINTYPE>(name) instead.")] @@ -107,18 +107,18 @@ public static string WhatDoIHave() { - return manager.WhatDoIHave(); + return container.WhatDoIHave(); } public static void AssertConfigurationIsValid() { - manager.AssertConfigurationIsValid(); + container.AssertConfigurationIsValid(); } #region Container and setting defaults - private static IContainer manager + private static IContainer container { get { @@ -136,6 +136,7 @@ return _manager; } } + public static string Profile @@ -145,7 +146,7 @@ lock (_lockObject) { _profile = value; - manager.SetDefaultsToProfile(_profile); + container.SetDefaultsToProfile(_profile); } } get { return _profile; } @@ -161,22 +162,22 @@ public static void Configure(Action<Registry> configure) { - manager.Configure(configure); + container.Configure(configure); } public static void SetDefault(Type pluginType, Instance instance) { - manager.SetDefault(pluginType, instance); + container.SetDefault(pluginType, instance); } public static void SetDefault<PLUGINTYPE>(Instance instance) { - manager.SetDefault<PLUGINTYPE>(instance); + container.SetDefault<PLUGINTYPE>(instance); } public static void SetDefault<PLUGINTYPE, CONCRETETYPE>() where CONCRETETYPE : PLUGINTYPE { - manager.SetDefault<PLUGINTYPE, CONCRETETYPE>(); + container.SetDefault<PLUGINTYPE, CONCRETETYPE>(); } @@ -230,7 +231,7 @@ /// <returns></returns> public static object GetInstance(Type pluginType) { - return manager.GetInstance(pluginType); + return container.GetInstance(pluginType); } /// <summary> @@ -240,17 +241,17 @@ /// <returns></returns> public static PLUGINTYPE GetInstance<PLUGINTYPE>() { - return (PLUGINTYPE) manager.GetInstance(typeof (PLUGINTYPE)); + return (PLUGINTYPE) container.GetInstance(typeof (PLUGINTYPE)); } public static object GetInstance(Type TargetType, Instance instance) { - return manager.GetInstance(TargetType, instance); + return container.GetInstance(TargetType, instance); } public static TargetType GetInstance<TargetType>(Instance instance) { - return (TargetType) manager.GetInstance(typeof (TargetType), instance); + return (TargetType) container.GetInstance(typeof (TargetType), instance); } /// <summary> @@ -261,7 +262,7 @@ /// <returns></returns> public static object GetNamedInstance(Type pluginType, string name) { - return manager.GetInstance(pluginType, name); + return container.GetInstance(pluginType, name); } /// <summary> @@ -272,17 +273,17 @@ /// <returns></returns> public static PLUGINTYPE GetNamedInstance<PLUGINTYPE>(string name) { - return (PLUGINTYPE) manager.GetInstance(typeof (PLUGINTYPE), name); + return (PLUGINTYPE) container.GetInstance(typeof (PLUGINTYPE), name); } public static void SetDefaultInstanceName(Type TargetType, string InstanceName) { - manager.SetDefault(TargetType, InstanceName); + container.SetDefault(TargetType, InstanceName); } public static void SetDefaultInstanceName<TargetType>(string InstanceName) { - manager.SetDefault(typeof (TargetType), InstanceName); + container.SetDefault(typeof (TargetType), InstanceName); } /// <summary> @@ -292,7 +293,7 @@ /// <returns></returns> public static IList GetAllInstances(Type pluginType) { - return manager.GetAllInstances(pluginType); + return container.GetAllInstances(pluginType); } /// <summary> @@ -302,7 +303,7 @@ /// <returns></returns> public static IList<PLUGINTYPE> GetAllInstances<PLUGINTYPE>() { - return manager.GetAllInstances<PLUGINTYPE>(); + return container.GetAllInstances<PLUGINTYPE>(); } /// <summary> @@ -313,7 +314,7 @@ /// <returns></returns> public static ExplicitArgsExpression With<T>(T arg) { - return manager.With(arg); + return container.With(arg); } /// <summary> @@ -323,7 +324,7 @@ /// <returns></returns> public static IExplicitProperty With(string argName) { - return manager.With(argName); + return container.With(argName); } Modified: trunk/Source/StructureMap/Pipeline/BuildPolicy.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/BuildPolicy.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Pipeline/BuildPolicy.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -31,5 +31,22 @@ } #endregion + + public bool Equals(BuildPolicy obj) + { + return !ReferenceEquals(null, obj); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj is BuildPolicy; + } + + public override int GetHashCode() + { + return 0; + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Pipeline/CacheInterceptor.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/CacheInterceptor.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Pipeline/CacheInterceptor.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -48,5 +48,10 @@ protected abstract void storeInCache(string instanceKey, Type pluginType, object instance); protected abstract bool isCached(string instanceKey, Type pluginType); protected abstract object retrieveFromCache(string instanceKey, Type pluginType); + + public override string ToString() + { + return GetType().FullName + " / " + _innerPolicy.ToString(); + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Pipeline/ExplicitArguments.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/ExplicitArguments.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Pipeline/ExplicitArguments.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -46,6 +46,8 @@ { foreach (KeyValuePair<string, object> arg in _args) { + if (arg.Value == null) continue; + instance.SetProperty(arg.Key, arg.Value.ToString()); instance.Child(arg.Key).Is(arg.Value); } @@ -62,11 +64,11 @@ } } - public class ExplicitInstance<PLUGINTYPE> : ConfiguredInstance + public class ExplicitInstance : ConfiguredInstance { private readonly ExplicitArguments _args; - public ExplicitInstance(ExplicitArguments args, Instance defaultInstance) + public ExplicitInstance(Type pluginType, ExplicitArguments args, Instance defaultInstance) { args.Configure(this); _args = args; @@ -78,7 +80,7 @@ } else { - setPluggedType(typeof(PLUGINTYPE)); + setPluggedType(pluginType); } } Modified: trunk/Source/StructureMap/Pipeline/HttpContextBuildPolicy.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/HttpContextBuildPolicy.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Pipeline/HttpContextBuildPolicy.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -5,6 +5,8 @@ { public class HttpContextBuildPolicy : CacheInterceptor { + private string _prefix = Guid.NewGuid().ToString(); + public static bool HasContext() { return HttpContext.Current != null; @@ -25,9 +27,9 @@ return HttpContext.Current.Items[getKey(instanceKey, pluginType)]; } - private static string getKey(string instanceKey, Type pluginType) + private string getKey(string instanceKey, Type pluginType) { - return string.Format("{0}:{1}", pluginType.AssemblyQualifiedName, instanceKey); + return string.Format("{0}:{1}:{2}", pluginType.AssemblyQualifiedName, instanceKey, _prefix); } protected override CacheInterceptor clone() Modified: trunk/Source/StructureMap/Pipeline/Instance.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/Instance.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Pipeline/Instance.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -33,6 +33,28 @@ set { _name = value; } } + public virtual object Build(Type pluginType, IBuildSession session) + { + object rawValue = createRawObject(pluginType, session); + return applyInterception(rawValue, pluginType); + } + + private object createRawObject(Type pluginType, IBuildSession session) + { + try + { + return build(pluginType, session); + } + catch (StructureMapException ex) + { + throw; + } + catch (Exception ex) + { + throw new StructureMapException(400, ex); + } + } + public InstanceInterceptor Interceptor { get { return _interceptor; } @@ -80,27 +102,7 @@ } } - public virtual object Build(Type pluginType, IBuildSession session) - { - object rawValue = createRawObject(pluginType, session); - return applyInterception(rawValue, pluginType); - } - private object createRawObject(Type pluginType, IBuildSession session) - { - try - { - return build(pluginType, session); - } - catch (StructureMapException ex) - { - throw; - } - catch (Exception ex) - { - throw new StructureMapException(400, ex); - } - } private object applyInterception(object rawValue, Type pluginType) { Modified: trunk/Source/StructureMap/Pipeline/LiteralInstance.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/LiteralInstance.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Pipeline/LiteralInstance.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -43,5 +43,10 @@ { return "Object: " + _object.ToString(); } + + public override string ToString() + { + return string.Format("LiteralInstance: {0}", _object); + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Pipeline/Profile.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/Profile.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Pipeline/Profile.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -63,6 +63,14 @@ } } + public void Merge(Profile destination) + { + foreach (KeyValuePair<Type, Instance> pair in _instances) + { + destination.SetDefault(pair.Key, pair.Value); + } + } + public void FindMasterInstances(PluginGraph graph) { Dictionary<Type, Instance> master = new Dictionary<Type, Instance>(); @@ -92,5 +100,7 @@ _instances.Add(destinationType, instance); } } + + } } \ No newline at end of file Modified: trunk/Source/StructureMap/Pipeline/ProfileManager.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/ProfileManager.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Pipeline/ProfileManager.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -10,16 +10,31 @@ private readonly Profile _default = new Profile(""); private readonly Profile _machineProfile = new Profile("MACHINE"); private readonly Dictionary<string, Profile> _profiles = new Dictionary<string, Profile>(); - private Profile _currentProfile; + private Profile _currentProfile = new Profile(string.Empty); private string _defaultMachineProfileName; private string _defaultProfileName; + private object _locker = new object(); public ProfileManager() { - _currentProfile = _default; + } + private void setProfile(Profile profile) + { + lock (_locker) + { + _currentProfile = new Profile(profile.Name); + profile.FillAllTypesInto(_currentProfile); + + if (!ReferenceEquals(profile, _default)) + { + _default.FillAllTypesInto(_currentProfile); + } + } + } + public string DefaultMachineProfileName { get { return _defaultMachineProfileName; } @@ -39,14 +54,14 @@ { if (string.IsNullOrEmpty(value)) { - _currentProfile = _default; + setProfile(_default); } else { validateHasProfile(value); - _currentProfile = getProfile(value); - _default.FillAllTypesInto(_currentProfile); + Profile profile = getProfile(value); + setProfile(profile); } } } @@ -70,6 +85,11 @@ { Profile profile = getProfile(profileName); profile.SetDefault(pluginType, instance); + if (profileName == _defaultProfileName || profileName == _defaultMachineProfileName) + { + _default.FillTypeInto(pluginType, instance); + _currentProfile.FillTypeInto(pluginType, instance); + } } private Profile getProfile(string profileName) @@ -95,7 +115,8 @@ public void SetDefault(Type pluginType, Instance instance) { - _default.SetDefault(pluginType, instance); + _currentProfile.SetDefault(pluginType, instance); + _default.FillTypeInto(pluginType, instance); } public Instance GetDefault(Type pluginType) @@ -115,7 +136,7 @@ backfillProfiles(); - _currentProfile = _default; + setProfile(_default); } private void backfillProfiles() @@ -181,6 +202,8 @@ { pair.Value.CopyDefault(basicType, templatedType); } + + CurrentProfile = CurrentProfile; } public void ImportFrom(ProfileManager source) @@ -190,12 +213,16 @@ Profile fromProfile = pair.Value; Profile toProfile = getProfile(pair.Key); - fromProfile.FillAllTypesInto(toProfile); + fromProfile.Merge(toProfile); } - source._default.FillAllTypesInto(_default); + source._default.Merge(_default); + + setProfileDefaults(new GraphLog()); + + CurrentProfile = CurrentProfile; } } } \ No newline at end of file Modified: trunk/Source/StructureMap/PipelineGraph.cs =================================================================== --- trunk/Source/StructureMap/PipelineGraph.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/PipelineGraph.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -10,7 +10,7 @@ public interface IPipelineGraphVisitor { - void PluginType(Type pluginType, Instance defaultInstance); + void PluginType(Type pluginType, Instance defaultInstance, IBuildPolicy policy); void Instance(Type pluginType, Instance instance); } @@ -86,8 +86,7 @@ Type pluginType = pair.Value.PluginType; Instance defaultInstance = _profileManager.GetDefault(pluginType); - visitor.PluginType(pluginType, defaultInstance); - pair.Value.ForEachInstance(instance => visitor.Instance(pluginType, instance)); + pair.Value.AcceptVisitor(visitor, defaultInstance); } @@ -106,7 +105,10 @@ { internal List<Instance> Instances = new List<Instance>(); - public void PluginType(Type pluginType, Instance defaultInstance){} + public void PluginType(Type pluginType, Instance defaultInstance, IBuildPolicy policy) + { + // don't care + } public void Instance(Type pluginType, Instance instance) { Modified: trunk/Source/StructureMap/Properties/AssemblyInfo.cs =================================================================== --- trunk/Source/StructureMap/Properties/AssemblyInfo.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/Properties/AssemblyInfo.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -12,4 +12,8 @@ [assembly : InternalsVisibleTo( "StructureMap.AutoMocking, PublicKey=00240000048000009400000006020000002400005253413100040000010001008d9a2a76e43cd9b1b1944b1f3b489a046b33f0bcd755b25cc5d3ed7b18ded38240d6db7578cd986c72d3feb4f94a7ab26fcfa41e3e4f41cf2c029fba91159db05c44d63f0b2bfac24353a07f4a1230dd3d4240340adafa2275277fa083c75958062cd0e60016701db6af7ae718efdf1e802a840595b49c290964255b3c60c494" + )] +[assembly: + InternalsVisibleTo( + "StructureMap.Testing, PublicKey=00240000048000009400000006020000002400005253413100040000010001008d9a2a76e43cd9b1b1944b1f3b489a046b33f0bcd755b25cc5d3ed7b18ded38240d6db7578cd986c72d3feb4f94a7ab26fcfa41e3e4f41cf2c029fba91159db05c44d63f0b2bfac24353a07f4a1230dd3d4240340adafa2275277fa083c75958062cd0e60016701db6af7ae718efdf1e802a840595b49c290964255b3c60c494" )] \ No newline at end of file Modified: trunk/Source/StructureMap/StructureMap.csproj =================================================================== --- trunk/Source/StructureMap/StructureMap.csproj 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/StructureMap.csproj 2008-07-10 20:49:46 UTC (rev 126) @@ -392,6 +392,7 @@ <None Include="..\structuremap.snk"> <Link>Properties\structuremap.snk</Link> </None> + <None Include="ConfigurationClasses.cd" /> <Compile Include="Configuration\DictionaryReader.cs" /> <Compile Include="Configuration\ITypeReader.cs" /> <Compile Include="Configuration\PrimitiveArrayReader.cs" /> Modified: trunk/Source/StructureMap/StructureMapConfiguration.cs =================================================================== --- trunk/Source/StructureMap/StructureMapConfiguration.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap/StructureMapConfiguration.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -99,6 +99,7 @@ public static PluginGraph GetPluginGraph() { ConfigurationParser[] parsers = _parserBuilder.GetParsers(); + PluginGraphBuilder pluginGraphBuilder = new PluginGraphBuilder(parsers, _registries.ToArray(), _log); return pluginGraphBuilder.Build(); } Modified: trunk/Source/StructureMap.DataAccess/IDatabaseEngine.cs =================================================================== --- trunk/Source/StructureMap.DataAccess/IDatabaseEngine.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap.DataAccess/IDatabaseEngine.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -15,4 +15,6 @@ IDataParameter CreateParameter(string parameterName, DbType dbType, bool isNullable); string GetParameterName(string logicalName); } + + } \ No newline at end of file Modified: trunk/Source/StructureMap.DataAccess/StructureMap.DataAccess.csproj =================================================================== --- trunk/Source/StructureMap.DataAccess/StructureMap.DataAccess.csproj 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap.DataAccess/StructureMap.DataAccess.csproj 2008-07-10 20:49:46 UTC (rev 126) @@ -11,8 +11,7 @@ <AssemblyKeyContainerName> </AssemblyKeyContainerName> <AssemblyName>StructureMap.DataAccess</AssemblyName> - <AssemblyOriginatorKeyFile> - </AssemblyOriginatorKeyFile> + <AssemblyOriginatorKeyFile>structuremap.snk</AssemblyOriginatorKeyFile> <DefaultClientScript>JScript</DefaultClientScript> <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> @@ -27,6 +26,7 @@ <UpgradeBackupLocation> </UpgradeBackupLocation> <OldToolsVersion>2.0</OldToolsVersion> + <SignAssembly>true</SignAssembly> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>bin\Debug\</OutputPath> @@ -219,6 +219,7 @@ <Compile Include="MSSQL\MSSQLDatabaseEngine.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="Oracle\OracleDatabaseEngine.cs" /> <Compile Include="ParameterCollection.cs"> <SubType>Code</SubType> </Compile> @@ -302,8 +303,10 @@ </ProjectReference> </ItemGroup> <ItemGroup> + <None Include="structuremap.snk" /> + </ItemGroup> + <ItemGroup> <Folder Include="Exceptions\" /> - <Folder Include="Oracle\" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> Added: trunk/Source/StructureMap.DataAccess/structuremap.snk =================================================================== (Binary files differ) Property changes on: trunk/Source/StructureMap.DataAccess/structuremap.snk ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/Source/StructureMap.Testing/Attributes/PluginFamilyAttributeTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/Attributes/PluginFamilyAttributeTester.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap.Testing/Attributes/PluginFamilyAttributeTester.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -44,7 +44,7 @@ return new InstanceMemento[0]; } - protected override bool containsKey(string instanceKey) + protected internal override bool containsKey(string instanceKey) { throw new NotImplementedException(); } Modified: trunk/Source/StructureMap.Testing/Configuration/DSL/AddInstanceTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/Configuration/DSL/AddInstanceTester.cs 2008-06-23 17:44:01 UTC (rev 125) +++ trunk/Source/StructureMap.Testing/Configuration/DSL/AddInstanceTester.cs 2008-07-10 20:49:46 UTC (rev 126) @@ -14,7 +14,7 @@ [SetUp] public void SetUp() { - manager = new Container(registry => + container = new Container(registry => { registry.ScanAssemblies().IncludeAssemblyContainingType<ColorWidget>(); @@ -43,19 +43,19 @@ #endregion - private IContainer manager; + private IContainer container; [Test] public void AddAnInstanceWithANameAndAPropertySpecifyingConcreteKey() { - ... [truncated message content] |