Can I just remind everyone that (IMO) we shouldn't just be considering
filesystems here? I think it would be a pretty useful feature to have a
general tree manipulation interface, and then this could be applied to
filesystems, or XML, or LDAP, or SQL (although this doesn't map so well), or
whatever.
I guess the way I see it, you'd have something like this:
role Tree::Node {...}
role Filesystem::Node inherits from Tree::Node {...}
role Filesystem::Directory inherits from Filesystem::Node {...}
class Filesystem::File does Filesystem::Node { # Interface, like DBI
has $implementation handles *;
$implementation = Filesystem::File::XML->new();
}
class Filesystem::File::XML inherits from Filesystem::File::Base {...}
In the case of Filesystem::Node, you would define some standard
attribute names (eg. "owner", "is_readable"), but then they would be
accessible through the standard Tree::Node.get_attribute() interface. And the
standard Tree::Node.get_children() would be implemented by Filesystem::File as
something to fetch the contents of the file; in the case of
Filesystem::XMLFile, it would turn the contents into a tree of XML nodes.
I agree about the different levels of abstractions, but just wanted to
put in a plug for this one as one that I like.
:)
---------------------------------------------------------------------
| Name: Tim Nelson | Because the Creator is, |
| E-mail: [EMAIL PROTECTED] | I am |
---------------------------------------------------------------------
----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V-
PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----