|
From: <jer...@us...> - 2010-01-04 18:56:27
|
Revision: 320
http://structuremap.svn.sourceforge.net/structuremap/?rev=320&view=rev
Author: jeremydmiller
Date: 2010-01-04 18:56:18 +0000 (Mon, 04 Jan 2010)
Log Message:
-----------
Eliminated the FillDependencies methods
Modified Paths:
--------------
trunk/Source/StructureMap/Container.cs
trunk/Source/StructureMap/IContainer.cs
trunk/Source/StructureMap/StructureMap.csproj
trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs
trunk/Source/StructureMap.Testing/Graph/FillDependenciesTester.cs
Added Paths:
-----------
trunk/Source/StructureMap/Pipeline/BasicInstance.cs
Modified: trunk/Source/StructureMap/Container.cs
===================================================================
--- trunk/Source/StructureMap/Container.cs 2009-12-29 19:22:20 UTC (rev 319)
+++ trunk/Source/StructureMap/Container.cs 2010-01-04 18:56:18 UTC (rev 320)
@@ -155,11 +155,6 @@
return (T) GetInstance(typeof (T));
}
- [Obsolete("Please use GetInstance<T>() instead.")]
- public T FillDependencies<T>()
- {
- return (T) FillDependencies(typeof (T));
- }
/// <summary>
@@ -282,24 +277,7 @@
_pipelineGraph.SetDefault(pluginType, instance);
}
- [Obsolete("Please use GetInstance(Type) instead")]
- public object FillDependencies(Type type)
- {
- if (!type.IsConcrete())
- {
- throw new StructureMapException(230, type.FullName);
- }
- var plugin = new Plugin(type);
- if (!plugin.CanBeAutoFilled)
- {
- throw new StructureMapException(230, type.FullName);
- }
-
- return GetInstance(type);
- }
-
-
/// <summary>
/// Creates or resolves all registered instances of the pluginType
/// </summary>
Modified: trunk/Source/StructureMap/IContainer.cs
===================================================================
--- trunk/Source/StructureMap/IContainer.cs 2009-12-29 19:22:20 UTC (rev 319)
+++ trunk/Source/StructureMap/IContainer.cs 2010-01-04 18:56:18 UTC (rev 320)
@@ -104,13 +104,6 @@
/// <returns></returns>
T TryGetInstance<T>(string instanceKey);
-
- [Obsolete("Please use GetInstance<T>() instead.")]
- T FillDependencies<T>();
-
- [Obsolete("Please use GetInstance(Type) instead")]
- object FillDependencies(Type type);
-
/// <summary>
/// Used to add additional configuration to a Container *after* the initialization.
/// </summary>
Added: trunk/Source/StructureMap/Pipeline/BasicInstance.cs
===================================================================
--- trunk/Source/StructureMap/Pipeline/BasicInstance.cs (rev 0)
+++ trunk/Source/StructureMap/Pipeline/BasicInstance.cs 2010-01-04 18:56:18 UTC (rev 320)
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+
+namespace StructureMap.Pipeline
+{
+ public interface BasicInstance
+ {
+ Type PluggedType { get; }
+
+
+ Dictionary<string, string> Properties { get; }
+ Dictionary<string, Instance> Children { get; }
+ Dictionary<string, Instance[]> Arrays { get; }
+ }
+}
\ No newline at end of file
Modified: trunk/Source/StructureMap/StructureMap.csproj
===================================================================
--- trunk/Source/StructureMap/StructureMap.csproj 2009-12-29 19:22:20 UTC (rev 319)
+++ trunk/Source/StructureMap/StructureMap.csproj 2010-01-04 18:56:18 UTC (rev 320)
@@ -368,6 +368,7 @@
<Compile Include="Graph\PluggableAttributeScanner.cs" />
<Compile Include="Graph\PluginCache.cs" />
<Compile Include="IContext.cs" />
+ <Compile Include="Pipeline\BasicInstance.cs" />
<Compile Include="Pipeline\HybridLifecycle.cs" />
<Compile Include="Query\EmptyConfiguration.cs" />
<Compile Include="Query\GenericFamilyConfiguration.cs" />
@@ -403,7 +404,6 @@
<Compile Include="Query\Model.cs" />
<Compile Include="Pipeline\BuildFrame.cs" />
<Compile Include="Pipeline\BuildStack.cs" />
- <Compile Include="Pipeline\ConfiguredInstanceBase.cs" />
<Compile Include="Pipeline\InstanceKey.cs" />
<Compile Include="Pipeline\IStructuredInstance.cs" />
<Compile Include="Pipeline\PropertyExpression.cs" />
Modified: trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs
===================================================================
--- trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs 2009-12-29 19:22:20 UTC (rev 319)
+++ trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs 2010-01-04 18:56:18 UTC (rev 320)
@@ -45,7 +45,7 @@
var service2 = _container.GetInstance<IMockedService2>();
var service3 = _container.GetInstance<IMockedService3>();
- var concreteClass = _container.FillDependencies<ConcreteClass>();
+ var concreteClass = _container.GetInstance<ConcreteClass>();
Assert.AreSame(service, concreteClass.Service);
Assert.AreSame(service2, concreteClass.Service2);
Modified: trunk/Source/StructureMap.Testing/Graph/FillDependenciesTester.cs
===================================================================
--- trunk/Source/StructureMap.Testing/Graph/FillDependenciesTester.cs 2009-12-29 19:22:20 UTC (rev 319)
+++ trunk/Source/StructureMap.Testing/Graph/FillDependenciesTester.cs 2010-01-04 18:56:18 UTC (rev 320)
@@ -17,7 +17,7 @@
});
var concreteClass =
- (FilledConcreteClass) container.FillDependencies(typeof (FilledConcreteClass));
+ (FilledConcreteClass) container.GetInstance(typeof (FilledConcreteClass));
Assert.IsNotNull(concreteClass.Widget);
Assert.IsNotNull(concreteClass.Strategy);
@@ -27,7 +27,7 @@
public void TryToFillDependenciesOnAbstractClassThrowsException()
{
var manager = new Container();
- manager.FillDependencies(typeof (AbstractClass));
+ manager.GetInstance(typeof (AbstractClass));
}
@@ -35,7 +35,7 @@
public void TryToFillDependenciesOnClassWithPrimitiveArgumentsThrowsException()
{
var manager = new Container();
- manager.FillDependencies(typeof (CannotBeFilledConcreteClass));
+ manager.GetInstance(typeof (CannotBeFilledConcreteClass));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|