On Sep 13, 2005, at 1:37 AM, Marcus Boerger wrote:
there is no way in implementing multi-whatever observer and subjects
typesafe.
Java does it. (However, I am most definitely NOT suggesting emulating
java's solution in php.)
The other thing you mentioned, sending information along, is not
necessary
because you have access for what you really need, at least you can give
the access yourself by your design and i strongly encourage you do so.
Implementation note 6 in the patterns book talks about this, labeling
the two styles push and pull. Push is common, too. (for example in
PRADO and PEAR.) This interface mandates pull. I'm just suggesting
that this particular design for Subject and Observer is not generic.
There is more to the observer pattern than these interfaces express.
What is the value of defining a standard interface if it can only be
used in a fraction of the common cases and impedes extension?
I think that if Subject and Observer go into 5.1 as they are now, two
or more of the following will happen:
Most people won't be able to use them.
Many people will waste time trying to use them before finding the
limitations.
They will have to be extended later in a way that breaks backward
compatibility to get around those limitations.
A parallel, more capable, more mechanism will be developed and added
later.
They will have to be deprecated in a future release.
Is there a pressing need to have this in 5.1? Why not wait to a later
release and address some of the things that people commonly want to do
with the observer pattern:
Additional notification information (push style).
A observer that can receive more than one kind of notification.
A subject that can send more than one kind of notification.
Regards,
Jeff Moore
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php