On Tue, 2003-09-23 at 14:01, Javier Muniz wrote:
> What I meant was not the implementation, what I meant was that there was no
> way for the compiler/parser to know whether I was implementing position()
> from the Employee interface or the BoardMember interface, the declaration
> was ambiguous.
I would imagine priority would be based on the order of the named
interfaces. Thus in your example it would use the Employee position()
method.
Cheers,
Rob.
>
> If I implement the function there, then (from what I can tell) it becomes
> the position member for both the BoardMember interface AND the Employee
> interface. While this might be desired in some cases, it's definitely not
> desired in all cases, so there needs to be some other identifier (such as
> the implements keyword followed by which interface(s) this function should
> be used for).
>
> PHP5 may have such an identifier, but I have not found any documentation at
> this point...
>
> -Javier
>
> Marek Kilimajer wrote:
>
> > interface BoardMember
> > {
> > function position(); // used to set board position of board member
> > }
> > interface Employee
> > {
> > function position(); // used to set job title of employee
> > }
> >
> > class BusyBoardMember implements Employee, BoardMember
> > {
> > function position(); // what does this function do? ambiguous unless
> I
> > am missing something
> > }
>
> It is not ambiguous, you should implement the function here.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php