inversion-of-control
Telling StructureMap to use another Constructor
I have a c开发者_JS百科lass with 2 constructors. MyClass() and MyClass(IMyService service) How do I tell StructureMap then whenever I do a \'new MyClass()\' it should actually call the second cons[详细]
2023-03-26 19:44 分类:问答spring: how to add a property of a bean as a constructor arg
I have a bean (bean1) which has a method called getProperties() I开发者_运维知识库 need to pass the value of getProperties() as a constructor arg of another bean[详细]
2023-03-26 06:59 分类:问答Do I really add this line for each class in my model using ninject and NHibernate?
I am using NHibernate and ninject in ASP.Net MVC, using this page as a guide.One thing I think is weird is that, in this code (half way down the page)[详细]
2023-03-26 02:13 分类:问答Castle Windsor: How to pass commandline args to multiple services?
I want to pass command line args (ie. string[]args) to two different services. I tried a lot of things, closest is the code below.[详细]
2023-03-25 23:16 分类:问答Opennetcf IoC Calls my class's constructor twice
I have a class (named A) which uses another class (named B) as one of it\'s constructor\'s arguments by Openn开发者_开发知识库etcf\'s IoC Dependency Injection.[详细]
2023-03-24 22:55 分类:问答How to write JUnit for Adapter without overcomplicated code?
I have an adapter from I1 to ILogger implemented like this: class BAdapter() implements I1 { void logA() { // nothing }[详细]
2023-03-23 19:09 分类:问答How to avoid Service Locator Anti-Pattern?
I\'m trying to remove a Service Locator from an abstract base class, but I\'m not sure what to replace it with. Here is a psuedo-example of what I\'ve got:[详细]
2023-03-23 05:53 分类:问答How to set spring bean properties in a .properties resource file
Is this possible to se开发者_如何学Got a spring bean\'s properties through a dot notation in a .properties file. For example suppose you have defined:[详细]
2023-03-22 20:54 分类:问答How can an interface be completely independent of an implementation if we must specify method parameters
Pardon me if this is a naive question. An interface is supposed to hide the details of an implementation, but doesn\'t it necessarily reveal aspects of that implementation due to what parameters its m[详细]
2023-03-22 10:07 分类:问答How do I unit test a method like this using IOC
I\'m trying to wtire unit tests for a function that looks something like this: public List<int> Process(int input)[详细]
2023-03-22 07:23 分类:问答