+ 1
Communcation between objects
how would you advise i implement communication of data from one object to another. ex: I have a class A. I instantiate many objects A1, A2,.... Ax. I'd like A1 to send a value to some other An. (I'd rather not use a third party container object) thanks in advance
4 Antworten
+ 1
An.receiveInfo(A1.getData())
+ 1
not in my solution, it implies that An has a method to receive A1's data and A1 has a method to give this data
0
use the "baptiste's" method or like this..
An.result=A1.calcresult
0
but it implies that each An got a pointer to A1, isn't it?