in reply to Interfaces for the masses!
an interface is a class that defines a set of methods, without actually implementing any of them.
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). We can use subclassing, delegation, mixins, or anything else that fits our code.
[ Added You should look at the Dumper/Storable modules and things that implement freeze/thaw for examples of how perl has use interfaces successfully.]
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.
[Updated: there was originally an interesting Freudian slip and I've removed it.]
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Interfaces for the masses!
by rvosa (Curate) on Mar 24, 2006 at 01:06 UTC | |
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 |