Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
class MyClass { public: MyClass() { otherClass = new ConcreteClass(); } private: void FuncA() { otherClass->FuncB(); } IOtherClass* otherClass; };
我应该如何重新设计我的代码以使用从 IOtherClass 而不是 ConcreteClass 派生的模拟?假设我不能改变 FuncA()。