First off of course this is a made up problem that should never be implemented specifically in code. Parts, depending on what you mean, might be implemented in they system but not code specifically (design versus code.) But approaching it code wise.
sseth21k wrote:
1. The third person should not be able to see the other details of the class!
The implementation via class A. You have an API class that returns a proxy B. The caller uses B. B internally is implemented such that A supplies all the behavior. Specifically in C++ this means that A will NOT be in an include file. Rather it should be a source file. In ractical wise you would probably put in its own package with its own include file Code wise you could tighten this even further by delivering a binary rather than source code. Then all they could see would be the Proxy.
sseth21k wrote:
the component should be accessible to only that particular third person!
There is a credential class. It has specific data that identifies the caller. The API (above) is modified to take an instance of the credential class. The API checks the data to 'match' to the 'third person'. If it matches it returns the Proxy. If it doesn't match it returns null.