Section B.15. Chapter 16, Class Hierarchies


B.15. Chapter 16, Class Hierarchies

  • Don't manipulate the list of base classes directly. [Inheritance]

  • Use distributed encapsulated objects. [Objects]

  • Never use the one-argument form of bless. [Blessing Objects]

  • Pass constructor arguments as labeled values, using a hash reference. [Constructor Arguments]

  • Distinguish arguments for base classes by class name as well. [Base Class Initialization]

  • Separate your construction, initialization, and destruction processes. [Construction and Destruction]

  • Build the standard class infrastructure automatically. [Automating Class Hierarchies]

  • Use Class::Std to automate the deallocation of attribute data. [Attribute Demolition]

  • Have attributes initialized and verified automatically. [Attribute Building]

  • Specify coercions as :STRINGIFY, :NUMERIFY, and :BOOLIFY methods. [Coercions]

  • Use :CUMULATIVE methods instead of SUPER:: calls. [Cumulative Methods]

  • Don't use AUTOLOAD( ). [Autoloading]



Perl Best Practices
Perl Best Practices
ISBN: 0596001738
EAN: 2147483647
Year: 2004
Pages: 350
Authors: Damian Conway

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net