in reply to Re: Interfaces for the masses!
in thread Interfaces for the masses!
No, that's what Java thinks "interface" means. We have better things in perl. In fact, we have the freedom to define as much or as little of the that API (because that's really want you asked for).I don't think that was quite what I asked for. The issue lies not so much in how much / little has been implemented, but that there could be scope for a contract such that $obj->isa('Interface'); tells you more than duck-typing based on a single method call could. Outside of implementation details. Isn't that a good idea under some circumstances, even if my understanding of what an interface is comes from Java?
Added You should look at the Dumper/Storable modules and things that implement freeze/thaw for examples of how perl has use interfaces successfully.I just looked at Data::Dumper's and Storable's code. I don't see what you mean.
Also, we already have two iterator interfaces: the tieable file handle and closures. I'd rather not see a "Class::Interface::Iterator" because I'm sure it's going to be more verbose and less useful than the tools we already have in common use.Okay, the iterator interface might be a bit over the top seeing that perl has wonderful list processing capabilities. But what about other patterns? I imagine general 'Model', 'View' and 'Controller' interfaces would be handy for the Maypole/Catalyst crowd?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Interfaces for the masses!
by diotalevi (Canon) on Mar 24, 2006 at 05:58 UTC | |
by Anonymous Monk on Mar 28, 2006 at 03:42 UTC | |
by diotalevi (Canon) on Mar 28, 2006 at 03:45 UTC |