I have this abstract class:
using TypeLib=some.type.library;
namespace someSpace
{
abstract class Creator
{
abstract public TypeLib.SomeObject createObject();
}
}
Here's a concrete class:
using TypeLib=some.type.library;
namespace someSpace
{
class SpecialCreator:Creator
{
override public TypeLib.SomeObject createObject()
{
doSomethingSpecial();
return new TypeLib.SomeObject();
}
}
}
Because I will want to implement Creator
several different ways, all of which require importing some.type.library
because they need to return a TypeLib.someObject
, is there a way that I can just have the using
statement at some high level and have it be inherited by all the implementations? When I didn't include the using
statement in SpecialCreator()
, it didn't have access to TypeLib
.
EDIT: I think this is different than the duplicate directives question. I'm not trying to consolidate different using
statements into one master using
that I will then add to many classes; instead, I want to put one using
statement in a parent class/header file/static class/etc so that it can be accessible to many classes without having to add the same line of code to each class. Let me know if I've misunderstood the duplicate directives question.