I met a problem like this.
class A have a list of class B. A have choose one of B, and call its method. So A depends on B.
But when a timer ( not a real timer, just a mimic clock ) fires, B have to tell A that “I am done”, so A can choose another B to work, which means B has to know A also.
This is a “two way 1-n relationship” and I think A and B are not well seperated.
Of course I can use Observer Pattern and make A an observer and B a subject, but this is not a typical case where observer pattern make sense because there is only one observer.
What do u think about it?
A knows about the available Bs. B only knows about the A currently using him. I don’t think that’s 1-n is it?
But B doesn’t depend upon A as such, he does not care it’s an A. He just needs to use the “finished()” method of his temprary associate. There’s no real dependency there.
}
I don’t see unreasonable dependencies. A needs to know about buzz and to expose an interface. B only knows about the interface.