Regardless of whether or not this is a good idea, is it possible to implement an interface where the executing function is aware of the calling object\'s type?
c
I might be in trouble thinking I would handle this differently but....
I assume this:
class A calls on class E for information
class C calls on class E for information
both through the same method in E
You know and created all three classes and can hide the content of class E to the public. If this were not the case, your controll would always be lost.
Logically: if you can hide content of class E, you do this most likely by distributing through a DLL.
If you do this anyway, why not hide the content of classes A and C as well (same method) but allowing A and C to be used as base for derived classes B and D.
In classes A and C you would have a method to call the method in class E and deliver the result. In that method (usable by the derived class, but the content is hidden to the users) you can have long strings as "keys" passed to the method in class E. These strings could not be guessed by any user and would only be known to the base classes A, C and E.
Having the base classes encapsulate the knowledge of how to call the method in E correctly would be perfect OOP implementation I think
Then again... I could be overlooking the complexities here.