Tieing and Overloading Objects in Perl
Tieing and Overloading Objects in Perl
Par Dave Cross (davorg) de London.pm Date : mercredi 23 juillet 2003 14h15
Durée : 120 minutes Langue :
Using Object Orientation in your programming is a good way to make you
code more extensible and reusable. Unfortunately code that uses objects
is often less readable than it would otherwise have been.
By using tied variables and operator overloading in your object you can
make them easier to use. In many cases you can make you objects look a
lot more like "real" Perl variables.
This tutorial will introduce both of these features and will explain
both how and (more importantly) why they are used.
Topics covered will include:
-Why disguise objects?
-An introduction to tie
-Tieing scalars, arrays, hashes and filehandles
-Using Tie::StdFoo to be lazy
-Easier tie interfaces with Attribute::Handlers
-Extended examples of tied objects
-Review of tied objects available on CPAN
-Differences between overloaded methods and overloaded operators
-(Brief aside: overloaded methods in Perl)
-Introduction to overload.pm
-Overloading operators
-Overloading stringification and numerification
-The importance of copy constructors
-Overloading constants
-Extended examples of overloaded objects
-Review of ovrloaded objects on CPAN
-Summary and further information
Dernière modification du patron talk/show à 12:26:25 27-Jul-2013
Le contenu de ce site est copyright © 2003 Yet Another Society, Inc.
Pour toute question concernant ce site ou YAPC::EU 2003, écrivez à < yapc-help@mongueurs.net>.
Validations XHTML et
CSS.
|