[PEPr] Comment on RFC::NotificationCenter
| From: | Lukas Smith | Date: | Tue, 04 Jan 2005 13:18:42 +0000 |
| Subject: | [PEPr] Comment on RFC::NotificationCenter | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-35330@lists.php.net to get a copy of this message | ||
Lukas Smith (http://pear.php.net/user/lsmith) has commented on the proposal for
RFC::NotificationCenter.
Comment:
Since we dont have multiple inheritance having to inherit from some object
is a no go like Bertrand already mentioned in his reply. You can however
implement multiple interfaces so the interface route seems to make the
most sense.
So Bertrand the idea behind the Notification center is similar in a way to
ErrorStack. It means that every class that wants to use the Notification
center loads the code and then allows observers to register for that class
(or rather instances).
This would obviously prevent redundant code. It would provide more I/O
overhead which would however become less relevant expensive per package
the more packages use the notification center. So far we have only done
this for the PEAR base class (something we have gotten a bad name for,
however mainly due to design mistakes we mostly fixed by now). Its a
fundamental descision: Do we want to prevent code redundancy even if that
means that packages need to then require several (error handling,
notification center .. etc) infrastructure packages?
That is why I proposed the alternative of simply having a common interface
with a reference implementation (or maybe several for different specific
needs) that people essentially cut and paste. I am not so worried about
lines of code here. I am more worried about number of required files.
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=186
--
Sent by PEPr, the automatic proposal system at http://pear.php.net