www.digitalmars.com         C & C++   DMDScript  

D - Interface feature request

I would like it if a mechanism were added to allow an interface to 
specify that it was implemented by certain classes.

That way if the interface were written after the class (to which one, 
perhaps, did not have the source) one could still denote at interface 
build time that certain class(es) implemented the interface.

An advantage here is that code could be developed *AS IF* one had access 
to the complete source.  Logically the structure of the program would be 
the same as if each class specified which interfaces it implemented, but 
functions could be written that operated on all applicable classes by 
specifying the parameters via the interfaces that they needed.

This would allow a logically complete multiple inheritance to be 
available within an implemented single inheritance structure.  (The 
current system is complete only if one has the complete source code, and 
can make changes to the classes so that one says that they implement an 
interface that may not have been thought of at the time they were 
originally written.)
Mar 11 2004