Title: Advanced Object-Oriented Perl Length: 2 days (8 x 1.5-hour sessions) Variant: Also available in a 1-day version Presenter: Dr Damian Conway School of Computer Science and Software Engineering, Monash University, AUSTRALIA Target audience: Perl programmers who have a basic familiarity with simple hash-based OO Perl. What attendees will learn: This tutorial will show you how to build on the basic object-oriented Perl techniques you already know and unlock more of the power of Perl's OO capabilities. You will learn: * how to use pseudo-hashes and the standard fields.pm and base.pm modules; * how (and when) to bless arrays and scalars; * three different ways to implement data hiding for Perl objects (including the Tie::SecureHash module); * how Perl implements inheritance and polymorphism (and how you can change the rules of either); * how to simulate scalars, arrays, hashes, and typeglobs using ties; * the features (and traps) of operator overloading in Perl; * two easy ways to build complete classes (semi-)automatically; * how to do design-by-contract programming in OO Perl (using the Class::Contract module); * two ways to do generic programming in Perl; * how to use the Class::Classless module to build OO programs without classes; * how to use multiple dispatch (an advanced form of polymorphism ) to implement event-driven class hierarchies for simulation and GUI applications. Tutorial outline: * Review of Perl OO basics - packages, references, blessing - the three rules * Non-hash-based objects - arrays as objects - scalars as objects * Pseudo-hashes - what they are, how to use them as objects - the fields.pm module - compile-time type checking * Automating class construction and DBC programming - Class::Struct - design-by-contract with Class::Contract * Inheritance - revision of concepts - how they work in Perl - @ISA, isa(), can(), SUPER * Polymorphism - When and how to use it - Variations on the theme * Encapsulation - the pros and cons of data hiding - encapsulation via closures - encapsulation via scalars - encapsulation via the Tie::SecureHash module * Inheritance revisited - tricks with inherited constructors and destructors - abstract methods - attribute collisions - inheritance and pseudohashes: the base.pm module * Ties - simulating implementing scalars, arrays, hashes, typeglobs - scalar example (a maximizing scalar) - hash example (a case-insensitive hash) - Examples: an optimizing scalar; an approximate hash * Operator overloading - overview and limitations of mechanism - overloading operations, conversions, and constants - problems with references * Grafting other OO models onto Perl - classless programming with Class::Classless * Generic programming - Why you don't need it in Perl - How to do it anyway - Examples: generic lists; generic trees * Multiple dispatch - when regular polymorphism isn't enough - cascaded polymorphism - table driven dispatch - Class::Multimethods Presenter biography: Damian Conway holds a Ph.D. in Computer Science and is a Research Fellow with the School of Computer Science and Software Engineering at Monash University, Melbourne, Australia. He is the author of numerous well-known modules including: Class::Contract, Text::Autoformat, Parse::RecDescent, Text::Balanced, Lingua::EN::Inflect, Class::Multimethods, Switch, Quantum::Superpositions, NEXT, Filter::Simple, Attribute::Handlers, Inline::Files, and Coy (all available from your local CPAN mirror). Damian was the winner of the 1998, 1999, and 2000 Larry Wall Awards for Practical Utility. He is a member of the technical committee for The Perl Conference, a columnist for The Perl Journal, and author of the book "Object Oriented Perl". In 2001 Damian received the first "YAS Perl Development Grant" and has spent the year working on projects for the betterment of Perl.