使用 StructureMap 运行 ObjectFactory.WhatDoIHave() 时,看到相同依赖项的多个条目是否正常?例如,我看到:
ISomeClass (Some.Namespace.ISomeClass) 8cddad2d-565b-4a6f-b487-f4ec0225335d Configured Instance of Another.Namespace.SomeClass, Some.Assembly, Version=4.5.0.15805, Culture=neutral, PublicKeyToken=null
Scoped as: Transient
5e015488-4f81-48c2-a6c2-4b94a66de76c Configured Instance of Another.Namespace.SomeClass, Some.Assembly, Version=4.5.0.15805, Culture=neutral, PublicKeyToken=null
5fb1a6d9-395a-42db-a226-5563d35ac8aa Configured Instance of Another.Namespace.SomeClass, Some.Assembly, Version=4.5.0.15805, Culture=neutral, PublicKeyToken=null
d431713f-dbdb-41c4-993f-d696433d805f Configured Instance of Another.Namespace.SomeClass, Some.Assembly, Version=4.5.0.15805, Culture=neutral, PublicKeyToken=null
1a14e0cf-52f2-4f7a-ac71-937fa5faade9 Configured Instance of Another.Namespace.SomeClass, Some.Assembly, Version=4.5.0.15805, Culture=neutral, PublicKeyToken=null
c6f638e7-824d-42e2-9a90-765921ae1da9 Configured Instance of Another.Namespace.SomeClass, Some.Assembly, Version=4.5.0.15805, Culture=neutral, PublicKeyToken=null
7627f1d5-23a7-4220-a400-d8a3509028f0 Configured Instance of Another.Namespace.SomeClass, Some.Assembly, Version=4.5.0.15805, Culture=neutral, PublicKeyToken=null
c693eae9-00a3-46e8-a6b1-923a82a5d87c Configured Instance of Another.Namespace.SomeClass, Some.Assembly, Version=4.5.0.15805, Culture=neutral, PublicKeyToken=null
看到这个正常吗?随着我使用系统,条目的数量不断增加。
注意:请记住,我在接口和具体类之间只有一对一的关系。我从来没有同一个接口的多个实现。