With regards to design patterns such as GoF, is there a pattern to decribe when one object needs to observe another object that is not even in existance yet?
i.e.
$crystalBall = new crystalBall();
$futureDependent = new FutureDependent();
$futureDependent->attach($crystalBall);
...
then much later
....
$importantObject = new ImportantObject()
$crystalBall->sendToFutureDependent($importantObject);
......
then later again
$strawberriesAndCreamMmmmmLovely = $futureDependent->doStuffWithImportantObject();
Its kind of like an observer in reverse. But different in the sense that on observer gets notified of events.
were as this one just wants a reference to it when its created.
Any ideas?
Update - after commenting on Chacha102's answer i realise....Crystal Ball is a Registry...it helped by having to say the words... "difficult to get hold of"