Y
Y
yarushin_a2020-04-08 22:15:46
Design patterns
yarushin_a, 2020-04-08 22:15:46

How to access methods of an object through an interface?

Example: there are 2 isolated objects A and B, inherited from the interface, it is necessary that the object A has access to the methods of B through a single method of the interface. How to implement this because the objects do not know anything about each other's methods. Template virtual functions come to mind, but it's impossible to put everything together. I ask without criticism, I only delve into the patterns. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
P747, 2020-04-08
@P747

Try to make one common parent class through which communication between methods takes place

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question