.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "MakeMethods::Docs::RelatedModules 3pm" .TH MakeMethods::Docs::RelatedModules 3pm "2016-06-10" "perl v5.22.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Class::MakeMethods::Docs::RelatedModules \- Survey of Class Builders .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& http://search.cpan.org/search?mode=module&query=Class .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" There are a variety of modules on \s-1CPAN\s0 dedicated to the purpose of generating common constructor and accessor methods. Below, I survey several of these, summarizing some basic features and technical approaches, and comparing them to Class::MakeMethods and other modules. .SS "Caution" .IX Subsection "Caution" \&\fBPlease note that these comments are for basic comparison purposes only and may be incorrect or out of date.\fR Please consult the documentation from a current version of each module for more specific details. Corrections and clarifications would by welcomed by the author at the email address below. .SS "Points of Comparison" .IX Subsection "Points of Comparison" In general, I compared the following characteristics: .IP "Distribution" 4 .IX Item "Distribution" Is it included with Perl, or on \s-1CPAN\s0? Is it being actively maintained? .IP "Usage" 4 .IX Item "Usage" How do you go about declaring your class's methods? .IP "Mechanism" 4 .IX Item "Mechanism" How are they generated and delivered? .IP "Instance type" 4 .IX Item "Instance type" Are the objects of your class blessed hashes, or something else? .IP "Core Methods" 4 .IX Item "Core Methods" Does the module provide a constructor and basic accessors? Are there specialized methods for hash-ref, array-ref, and object-ref accessors? .IP "Extensible" 4 .IX Item "Extensible" Can you subclass the package to create new types of methods, or is there some other way to extend it? .IP "Other Methods" 4 .IX Item "Other Methods" Other types of methods provided. .IP "Emulator" 4 .IX Item "Emulator" Does Class::MakeMethods provide a drop-in replacement for this module? .IP "Comments" 4 .IX Item "Comments" Other characteristics or features of note. .SH "RELATED MODULES" .IX Header "RELATED MODULES" .SS "accessors" .IX Subsection "accessors" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Uploaded Sep 2003. .IP "Comments" 4 .IX Item "Comments" I have not yet reviewed this module in detail. .IP "Example" 4 .IX Item "Example" .Vb 2 \& package MyObject; \& use accessors qw( foo bar baz ); .Ve .SS "Attribute::Property" .IX Subsection "Attribute::Property" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 .IP "Comments" 4 .IX Item "Comments" I have not yet reviewed this module in detail. .SS "Class::Accessor" .IX Subsection "Class::Accessor" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 4/01. .IP "Usage" 4 .IX Item "Usage" Inherit and call function with declaration arguments .IP "Mechanism" 4 .IX Item "Mechanism" Generates and installs closures .IP "Instance Type" 4 .IX Item "Instance Type" Hash. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Cleanly. .IP "Standard Methods" 4 .IX Item "Standard Methods" Scalar accessors. .IP "Extensible" 4 .IX Item "Extensible" Yes. .IP "Comments" 4 .IX Item "Comments" Accessor methods call overwritable \f(CW\*(C`self\-mk_accessors(qw( simple ordered mapping obj_ref )); .Ve .SS "Class::Class" .IX Subsection "Class::Class" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 1/00. .IP "Usage" 4 .IX Item "Usage" Inherit and fill \f(CW%MEMBERS\fR hash; methods created when first object is created .IP "Mechanism" 4 .IX Item "Mechanism" Generates and installs closures .IP "Instance Type" 4 .IX Item "Instance Type" Hash. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Yes. .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and various accessors. .IP "Extensible" 4 .IX Item "Extensible" No. .IP "Example" 4 .IX Item "Example" Usage is similar to Class::Struct: .Sp .Vb 9 \& package MyObject; \& use Class::Class; \& @ISA = qw(Class::Class); \& %MEMBERS = ( \& simple => \*(Aq$\*(Aq, \& ordered => \*(Aq@\*(Aq, \& mapping => \*(Aq%\*(Aq, \& obj_ref => \*(AqFooObject\*(Aq \& ); .Ve .IP "Other Method Types" 4 .IX Item "Other Method Types" Provides a \fIpolymorph()\fR method that is similar to Class::Method's \*(L"ClassName:class_name \-require\*(R". .SS "Class::Constructor" .IX Subsection "Class::Constructor" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 11/01. .IP "Usage" 4 .IX Item "Usage" Inherit and call function with declaration arguments .IP "Mechanism" 4 .IX Item "Mechanism" Generates and installs closures .IP "Instance Type" 4 .IX Item "Instance Type" Hash. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Cleanly. .IP "Standard Methods" 4 .IX Item "Standard Methods" Hash constructor, with bells. .IP "Extensible" 4 .IX Item "Extensible" No. .IP "Emulator" 4 .IX Item "Emulator" No, but possible. .IP "Example" 4 .IX Item "Example" .Vb 3 \& package MyObject; \& @ISA = qw(Class::Constructor); \& MyObject\->mk_constructor( Name => \*(Aqnew\*(Aq ); .Ve .SS "Class::Classgen" .IX Subsection "Class::Classgen" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 12/00. .IP "Usage" 4 .IX Item "Usage" Pre-processor run against declaration files. .IP "Mechanism" 4 .IX Item "Mechanism" Assembles and saves code file .IP "Instance Type" 4 .IX Item "Instance Type" Hash. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Yes. (I think.) .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and various accessors. .IP "Extensible" 4 .IX Item "Extensible" No. (I think.) .IP "Example" 4 .IX Item "Example" .Vb 7 \& header: \& package MyObject; \& variables: \& $simple \& @ordered \& %mapping \& $obj_ref .Ve .SS "Class::Contract" .IX Subsection "Class::Contract" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 5/01. .IP "Usage" 4 .IX Item "Usage" Call function with declaration arguments .IP "Mechanism" 4 .IX Item "Mechanism" Generates and installs closures .IP "Instance Type" 4 .IX Item "Instance Type" Scalar reference with external data storage. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Yes. .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and various accessors. .IP "Extensible" 4 .IX Item "Extensible" Yes. (I think.) .IP "Comments" 4 .IX Item "Comments" Supports pre\- and post-conditions, class invariants, and other software engineering goodies. .IP "Example" 4 .IX Item "Example" .Vb 9 \& package MyObject; \& use Class::Contract; \& contract { \& ctor \*(Aqnew\*(Aq; \& attr \*(Aqsimple\*(Aq => SCALAR; \& attr \*(Aqordered\*(Aq => ARRAY; \& attr \*(Aqmapping\*(Aq => HASH; \& attr \*(Aqobj_ref\*(Aq => \*(AqFooObject\*(Aq; \& } .Ve .SS "Class::Data::Inheritable" .IX Subsection "Class::Data::Inheritable" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 4/00. .IP "Usage" 4 .IX Item "Usage" Inherit and call function with declaration arguments .IP "Mechanism" 4 .IX Item "Mechanism" Generates and installs closures .IP "Instance Type" 4 .IX Item "Instance Type" Class data, with inheritance. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Yes, specifically. .IP "Standard Methods" 4 .IX Item "Standard Methods" Scalar accessors. .IP "Extensible" 4 .IX Item "Extensible" No. .IP "Example" 4 .IX Item "Example" Usage is similar to Class::Accessor: .Sp .Vb 3 \& package MyObject; \& @ISA = qw(Class::Data::Inheritable); \& MyObject\->mk_classdata(qw( simple ordered mapping obj_ref )); .Ve .IP "Emulator" 4 .IX Item "Emulator" Yes, Class::MakeMethods::Emulator::Inheritable, passes original test suite. .SS "Class::Delegate" .IX Subsection "Class::Delegate" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Uploaded 12/0. .IP "Comments" 4 .IX Item "Comments" I have not yet reviewed this module in detail. .SS "Class::Delegation" .IX Subsection "Class::Delegation" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Uploaded 12/01. .IP "Comments" 4 .IX Item "Comments" I have not yet reviewed this module in detail. .SS "Class::Generate" .IX Subsection "Class::Generate" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 11/00. .IP "Usage" 4 .IX Item "Usage" Call function with declaration arguments .IP "Mechanism" 4 .IX Item "Mechanism" Assembles and evals code string, or saves code file. .IP "Instance Type" 4 .IX Item "Instance Type" Hash. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Yes. .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and accessors (scalar, array, hash, object, object array, etc). .IP "Extensible" 4 .IX Item "Extensible" Unknown. .IP "Comments" 4 .IX Item "Comments" Handles private/protected limitations, pre and post conditions, assertions, and more. .IP "Example" 4 .IX Item "Example" Usage is similar to Class::Struct: .Sp .Vb 8 \& package MyObject; \& use Class::Generate; \& class MyObject => [ \& simple => \*(Aq$\*(Aq, \& ordered => \*(Aq@\*(Aq, \& mapping => \*(Aq%\*(Aq, \& obj_ref => \*(AqFooObject\*(Aq \& ]; .Ve .SS "Class::Hook" .IX Subsection "Class::Hook" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Uploaded 12/01. .IP "Comments" 4 .IX Item "Comments" I have not yet reviewed this module in detail. .SS "Class::Holon" .IX Subsection "Class::Holon" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Experimental/Alpha release 07/2001. .IP "Instance Type" 4 .IX Item "Instance Type" Hash, array, or flyweight-index. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" No. (I think.) .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and scalar accessors; flywieght objects also get scalar mutator methods. .IP "Extensible" 4 .IX Item "Extensible" No. (I think.) .IP "Comments" 4 .IX Item "Comments" I'm not sure I understand the intent of this module; perhaps future versions will make this clearer.... .SS "Class::MethodMaker" .IX Subsection "Class::MethodMaker" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 1/01. .IP "Usage" 4 .IX Item "Usage" Import, or call function, with declaration arguments .IP "Mechanism" 4 .IX Item "Mechanism" Generates and installs closures .IP "Instance Type" 4 .IX Item "Instance Type" Hash, Static. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Yes. .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and various accessors. .IP "Extensible" 4 .IX Item "Extensible" Yes. .IP "Example" 4 .IX Item "Example" Usage is similar to Class::MakeMethods: .Sp .Vb 8 \& package MyObject; \& use Class::MethodMaker ( \& new => \*(Aqnew\*(Aq, \& get_set => \*(Aqsimple\*(Aq, \& list => \*(Aqordered\*(Aq, \& hash => \*(Aqmapping\*(Aq, \& object => [ \*(AqFooObject\*(Aq => \*(Aqobj_ref\*(Aq ], \& ); .Ve .IP "Emulator" 4 .IX Item "Emulator" Yes, Class::MakeMethods::Emulator::MethodMaker, passes original test suite. .SS "Class::MakeMethods" .IX Subsection "Class::MakeMethods" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 .IP "Usage" 4 .IX Item "Usage" Import, or call function, with declaration arguments; or if desired, make methods on-demand with Autoload, or declare subroutines with a special Attribute. .IP "Mechanism" 4 .IX Item "Mechanism" Generates and installs closures .IP "Instance Type" 4 .IX Item "Instance Type" Hash, Array, Scalar, Static, Class data, others. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Yes. .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and various accessors. .IP "Extensible" 4 .IX Item "Extensible" Yes. .IP "Example" 4 .IX Item "Example" Usage is similar to Class::MethodMaker: .Sp .Vb 8 \& package MyObject; \& use Class::MakeMethods::Hash ( \& new => \*(Aqnew\*(Aq, \& scalar => \*(Aqsimple\*(Aq, \& array => \*(Aqordered\*(Aq, \& hash => \*(Aqmapping\*(Aq, \& object => [ \*(Aqobj_ref\*(Aq, { class=>\*(AqFooObject\*(Aq } ], \& ); .Ve .SS "Class::Maker" .IX Subsection "Class::Maker" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 7/02. .IP "Usage" 4 .IX Item "Usage" Call function with declaration arguments. .IP "Mechanism" 4 .IX Item "Mechanism" Generates and installs closures (I think). .IP "Instance Type" 4 .IX Item "Instance Type" Hash (I think). .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Unknown. .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and various scalar and reference accessors. .IP "Extensible" 4 .IX Item "Extensible" Unknown. .IP "Comments" 4 .IX Item "Comments" I haven't yet reviewed this module closely. .SS "Class::SelfMethods" .IX Subsection "Class::SelfMethods" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 2/00. .IP "Usage" 4 .IX Item "Usage" Inherit; methods created via \s-1AUTOLOAD\s0 .IP "Mechanism" 4 .IX Item "Mechanism" Generates and installs closures (I think) .IP "Instance Type" 4 .IX Item "Instance Type" Hash. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Yes. .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and scalar/code accessors (see Comments). .IP "Extensible" 4 .IX Item "Extensible" No. .IP "Comments" 4 .IX Item "Comments" Individual objects may be assigned a subroutine that will be called as a method on subsequent accesses. If an instance does not have a value for a given accessor, looks for a method defined with a leading underscore. .SS "Class::Struct" .IX Subsection "Class::Struct" .IP "Distribution" 4 .IX Item "Distribution" Included in the standard Perl distribution. Replaces Class::Template. .IP "Usage" 4 .IX Item "Usage" Call function with declaration arguments .IP "Mechanism" 4 .IX Item "Mechanism" Assembles and evals code string .IP "Instance Type" 4 .IX Item "Instance Type" Hash or Array .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" No. .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and various accessors. .IP "Extensible" 4 .IX Item "Extensible" No. .Sp .Vb 8 \& package MyObject; \& use Class::Struct; \& struct( \& simple => \*(Aq$\*(Aq, \& ordered => \*(Aq@\*(Aq, \& mapping => \*(Aq%\*(Aq, \& obj_ref => \*(AqFooObject\*(Aq \& ); .Ve .IP "Emulator" 4 .IX Item "Emulator" Yes, Class::MakeMethods::Emulator::Struct. .SS "Class::StructTemplate" .IX Subsection "Class::StructTemplate" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 12/00. .Sp No documentation available. .IP "Usage" 4 .IX Item "Usage" Unknown. .IP "Mechanism" 4 .IX Item "Mechanism" Unknown. .SS "Class::Template" .IX Subsection "Class::Template" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Out of date. .IP "Usage" 4 .IX Item "Usage" Call function with declaration arguments (I think) .IP "Mechanism" 4 .IX Item "Mechanism" Assembles and evals code string (I think) .IP "Instance Type" 4 .IX Item "Instance Type" Hash. .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Yes. (I think.) .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and various accessors. .IP "Extensible" 4 .IX Item "Extensible" No. (I think.) .IP "Example" 4 .IX Item "Example" Usage is similar to Class::Struct: .Sp .Vb 8 \& package MyObject; \& use Class::Template; \& members MyObject { \& simple => \*(Aq$\*(Aq, \& ordered => \*(Aq@\*(Aq, \& mapping => \*(Aq%\*(Aq, \& obj_ref => \*(AqFooObject\*(Aq \& }; .Ve .SS "Class::Virtual" .IX Subsection "Class::Virtual" Generates methods that fail with a message indicating that they were not implemented by the subclass. (Cf. 'Template::Universal:croak \-abstract'.) .PP Also provides a list of abstract methods that have not been implemented by a subclass. .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN.\s0 Last update 3/01. .IP "Extensible" 4 .IX Item "Extensible" Unknown. .IP "Mechanism" 4 .IX Item "Mechanism" Uses Class::Data::Inheritable and installs additional closures. .SS "CodeGen::PerlBean" .IX Subsection "CodeGen::PerlBean" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN. \s0 .IP "Usage" 4 .IX Item "Usage" Call function with declaration arguments. .IP "Mechanism" 4 .IX Item "Mechanism" Generates and writes source code to a file. .IP "Instance Type" 4 .IX Item "Instance Type" Hash (I think). .IP "Subclasses Cleanly" 4 .IX Item "Subclasses Cleanly" Unknown. .IP "Standard Methods" 4 .IX Item "Standard Methods" Constructor and various scalar and reference accessors. .IP "Extensible" 4 .IX Item "Extensible" Unknown. .IP "Comments" 4 .IX Item "Comments" I haven't yet reviewed this module closely. .SS "HTML::Mason::MethodMaker" .IX Subsection "HTML::Mason::MethodMaker" .IP "Distribution" 4 .IX Item "Distribution" \&\s-1CPAN. \s0 .IP "Usage" 4 .IX Item "Usage" Package import with declaration arguments .IP "Mechanism" 4 .IX Item "Mechanism" Generates and installs closures .IP "Instance Type" 4 .IX Item "Instance Type" Hash. .IP "Standard Methods" 4 .IX Item "Standard Methods" Scalar accessors. .IP "Extensible" 4 .IX Item "Extensible" No. .IP "Example" 4 .IX Item "Example" .Vb 3 \& use HTML::Mason::MethodMaker ( \& read_write => [ qw( simple ordered mapping obj_ref ) ] \& ); .Ve .SH "TO DO" .IX Header "TO DO" The following modules are relevant but have not yet been cataloged above. .SS "Attribute::Property" .IX Subsection "Attribute::Property" .SS "Class::Accessor::Chained" .IX Subsection "Class::Accessor::Chained" .SS "Class::Accessor::Lvalue" .IX Subsection "Class::Accessor::Lvalue" .SS "Class::Accessor::Ref" .IX Subsection "Class::Accessor::Ref" .SS "Class::AutoClass" .IX Subsection "Class::AutoClass" .SS "Class::Builder" .IX Subsection "Class::Builder" .SS "Class::Member" .IX Subsection "Class::Member" .SS "Class::Trigger" .IX Subsection "Class::Trigger" .SH "SEE ALSO" .IX Header "SEE ALSO" See Class::MakeMethods for general information about this distribution. .SH "CREDITS AND COPYRIGHT" .IX Header "CREDITS AND COPYRIGHT" .SS "Developed By" .IX Subsection "Developed By" .Vb 2 \& M. Simon Cavalletto, simonm@cavalletto.org \& Evolution Softworks, www.evoscript.org .Ve .SS "Copyright" .IX Subsection "Copyright" Copyright 2002 Matthew Simon Cavalletto. .PP Portions copyright 2000, 2001 Evolution Online Systems, Inc. .SS "License" .IX Subsection "License" You may use, modify, and distribute this document under the same terms as Perl.