A
Angus
Hello
I am creating a C++ framework for working with telephone systems.
There are a lot of different interfaces and this is the main problem.
Currently my basic design is as follows:
Abstract factory pattern. Creates a telephony object without
specifying concrete classes.
The telephony object then creates a interface class (IFace) which has
supporting device and call classes. The IFACE class has a list of the
calls and devices. Devices are for example a telephone handset.
The IFace, device and call objects are abstract. Then I have these
sort of interfaces for actual implementation:
class ABCPhone: public IFace
class ABCDevice : public device
class ABCCall : public call
Currently I am working on two actual implementations - lets call them
ABC and XYX.
When I created the ABC implementation I would create for example ABC
devices and calls and put a lot of the device and call processing code
in IFace, device and call. This has the advantage that anything in
the abstract classes can be re-used. But the problem is that now I am
developing XYZ interface, the standard code in these abstract classes
needs to be extended to cope with the peculiarities of XYZ.
Unfortunately XYZ is quite different to ABC.
So I am re-writing a lot of the code originally in IFace, device and
call into ABCPhone, ABCDevice and ABCCall. That is fine but means I
will have quite a lot of specific code for each implementation (longer
development cycles).
For example, is it a good idea to have a list of eg call objects in
the IFace class? If I need to extend call for specific
implementations then I need a list of XYZCalls for example? Then no
need for a list of call's?
Any tips on how to design this would be much appreciated.
A
I am creating a C++ framework for working with telephone systems.
There are a lot of different interfaces and this is the main problem.
Currently my basic design is as follows:
Abstract factory pattern. Creates a telephony object without
specifying concrete classes.
The telephony object then creates a interface class (IFace) which has
supporting device and call classes. The IFACE class has a list of the
calls and devices. Devices are for example a telephone handset.
The IFace, device and call objects are abstract. Then I have these
sort of interfaces for actual implementation:
class ABCPhone: public IFace
class ABCDevice : public device
class ABCCall : public call
Currently I am working on two actual implementations - lets call them
ABC and XYX.
When I created the ABC implementation I would create for example ABC
devices and calls and put a lot of the device and call processing code
in IFace, device and call. This has the advantage that anything in
the abstract classes can be re-used. But the problem is that now I am
developing XYZ interface, the standard code in these abstract classes
needs to be extended to cope with the peculiarities of XYZ.
Unfortunately XYZ is quite different to ABC.
So I am re-writing a lot of the code originally in IFace, device and
call into ABCPhone, ABCDevice and ABCCall. That is fine but means I
will have quite a lot of specific code for each implementation (longer
development cycles).
For example, is it a good idea to have a list of eg call objects in
the IFace class? If I need to extend call for specific
implementations then I need a list of XYZCalls for example? Then no
need for a list of call's?
Any tips on how to design this would be much appreciated.
A