--- Ken Williams <[EMAIL PROTECTED]> wrote:
> If I were you I'd not use classes to model that part of it.  Just
> have 
> a Printer::Status::HP4500 (or HP::HP4500 or whatever) object with a 
> components() or consumables() method that returns a hash mapping name
> to properties.  E.g.:

"If you say you're going to take Vienna, take Vienna."

Napoleon  

In this case, if an OO interface is provided, it should be used.  A
hash mapping makes it very easy to mitsype (sic) the key names.  It's
more difficult to mistype method names and have it still work.  If one
doesn't want the overhead of creating a class just for the returned
data, one call always use the excellent Hash::AsObject
(http://search.cpan.org/~nkuitse/Hash-AsObject-0.05/) module.

Cheers,
Ovid

=====
Silence is Evil            
http://users.easystreet.com/ovid/philosophy/decency.html
Ovid                       http://www.perlmonks.org/index.pl?node_id=17000
Web Programming with Perl  http://users.easystreet.com/ovid/cgi_course/

Reply via email to