?
=?iso-8859-1?q?Ernesto_Basc=F3n?=
Opinions.
I want to create an OO UI framework.
I want to define a set of ABCs like:
class IA
{
virtual int GetA() = 0;
};
class IB : public IA
{
virtual double GetB() = 0;
};
class IC : public IA, public virtual IB
{
virtual char GetC() = 0;
};
After that, I want to create a set of implementation for my ABCs:
class A : public IA
{
virtual int GetA() { return 1;}
};
class B : public A, public virtual IB
{
virtual double GetB() { return 0.5; }
};
class C : public A, public B, public virtual IC
{
virtual char GetC() { return 'h'; }
};
The rational behind this is to provide the interfaces totally separated
from the implementation (providing different headers and implemented in
another shared library), adding this and working just with the
interfaces and with factory methods, I will be able to create instances
of my implementation or of third party implementations and if my
implementation mirrors the same class hierarchy than the ABCs, I will
be able to reuse the code already implemented in the base concrete
classes.
Do you consider my design as good? Do you think I should consider some
issues?
Do you think it is not a good design or that it could be improved?
Any comment will be very important to me.
Ernesto
I want to create an OO UI framework.
I want to define a set of ABCs like:
class IA
{
virtual int GetA() = 0;
};
class IB : public IA
{
virtual double GetB() = 0;
};
class IC : public IA, public virtual IB
{
virtual char GetC() = 0;
};
After that, I want to create a set of implementation for my ABCs:
class A : public IA
{
virtual int GetA() { return 1;}
};
class B : public A, public virtual IB
{
virtual double GetB() { return 0.5; }
};
class C : public A, public B, public virtual IC
{
virtual char GetC() { return 'h'; }
};
The rational behind this is to provide the interfaces totally separated
from the implementation (providing different headers and implemented in
another shared library), adding this and working just with the
interfaces and with factory methods, I will be able to create instances
of my implementation or of third party implementations and if my
implementation mirrors the same class hierarchy than the ABCs, I will
be able to reuse the code already implemented in the base concrete
classes.
Do you consider my design as good? Do you think I should consider some
issues?
Do you think it is not a good design or that it could be improved?
Any comment will be very important to me.
Ernesto