public class ConcreteService1: IService1
{
private IService2 _service2;
public void doSomething()
{
_service2 = new ConcreteService2();
.....
}
}
public class ConcreateService2: IService2
{
private IService1 _service1;
public void doSomething()
{
_service1 = new ConcreteService1();
.....
}
}
这是可以在这里使用工厂或抽象工厂的情况吗?如果是,请您举个例子。