M
mmcgarry.work
Hi,
I would like to follow Stroustrup's advice of separating an object
interface (abstract class) from an object implementation (concrete
class), See Section 15.2.5 in Stroustrup 3rd Edition.
Specifically, I want to create an abstract base class that defines an
object interface:
class myAbstractClass
{
virtual func1() = 0;
virtual func2() = 0;
virtual func3() = 0;
};
I would then have one or more concrete classes that override these
virtual functions to implement this interface.
class usefulClass
: public myAbstractClass // interface
, protected myImplClass1 // implementation of func1() and func2()
, protected myImpClass2 // implementation of func3()
{
...
};
Essentially usefulClass glues together implementation classes that
fill out the interface defined by the abstract class. I would like to
know how to quantify the run-time overhead for this? Is it greater
then the run-time overhead of just inheriting a single concrete base
class?
Thanks for any help,
Michael
I would like to follow Stroustrup's advice of separating an object
interface (abstract class) from an object implementation (concrete
class), See Section 15.2.5 in Stroustrup 3rd Edition.
Specifically, I want to create an abstract base class that defines an
object interface:
class myAbstractClass
{
virtual func1() = 0;
virtual func2() = 0;
virtual func3() = 0;
};
I would then have one or more concrete classes that override these
virtual functions to implement this interface.
class usefulClass
: public myAbstractClass // interface
, protected myImplClass1 // implementation of func1() and func2()
, protected myImpClass2 // implementation of func3()
{
...
};
Essentially usefulClass glues together implementation classes that
fill out the interface defined by the abstract class. I would like to
know how to quantify the run-time overhead for this? Is it greater
then the run-time overhead of just inheriting a single concrete base
class?
Thanks for any help,
Michael