NAME Decorator - Abstract base class for Decorator classes and objects DESCRIPTION The "Decorator" class is intended as an abstract base class for creating any sort of class or object that follows the Decorator pattern It is also indended to serve as the base of a new namespace that will hold a variety of different Decorator-related toolkits and factory modules. In my opinion there is too much potential for variety to just shove all the different modules under Class:: somewhere. The "Decorator" class itself supplies only two methods, a default constructor and a private method to access the underlying object. What can I do with Decorator Well actually... nothing. The base "Decorator" class doesn't even implement a way to push method calls through to the underlying object, since the way in which THAT happens is the bit that changes from case to case. To actually DO something, you probably want to go take a look at Decorator::Factory. Which should exist soon... :) METHODS new $object The default "new" constructor takes a single object as argument and creates a new object which holds the passed object. Returns a new "Decorator" object (but far more likely a sub-class), or "undef" if you do not pass a blessed object parameter. __OBJECT The "__OBJECT" method is provided primarily as a convenience, and a tool for people implementing sub-classes, and allows the "Decorator" interface to provide a guarenteed correct way of getting to the underlying object, should you need to do so. BUGS It's early day yet, so you should expect "Decorator" will change a bit. SUPPORT Bugs should be reported via the CPAN bug tracker at For other issues, contact the author. TO DO - Write Decorator::Factory - Write some basic standard Decorator base classes for the main ways in which Decorators are used. AUTHOR Adam Kennedy (Maintainer), , cpan@ali.as SEE ALSO Class::Decorator, Decorator::Factory COPYRIGHT Copyright 2005 Adam Kennedy. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module.