On 8/1/07, Rafael Morales <[EMAIL PROTECTED]> wrote:
> Hi list,
>
> I'm using some design patterns (MVC, Observer, Strategy), with Perl, however 
> I see that I need to create some interfaces (watching examples in Java and 
> C++), but I don't know how to create these interfaces with Perl, for example 
> in Java this is done with this:
>
>    public interface SomeName () {
>        # some code
>    }
>
> Is this possible with Perl or is there any other way for do it ???
>
> Regards and thanks to all !!!


If I remember correctly, interfaces in Java are a hack to get around
the fact that you can't do multiple inheritance.  Perl can do multiple
inheritance*, so all you need to do is create a new class SomeName and
have other class inherites from it (the base pragma is the easiest
way).

* whether this is a good or bad thing depends on how likely you are to
run into diamond inheritance, and the other problems multiple
inheritance can cause.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to