Nathan Byrd wrote:
[...]
fields Pragma
-------------
Advantages:
* More straightforward approach
* Less code to add to module

Disadvantages:
* Based on pseudo-hashes - may have problems with reloading, etc
* Unknown whether it changes performance (due to "typed lexical"
limitation of pragma)
* Forces developers to 'use base' and/or 'use fields' in sub-class, can
cause non-obvious error otherwise

Array based
-----------
Advantages:
* Easy to change code to change base class implementation in the future
* Good encapsulation (ability to override methods in future without
breaking sub-classes)

Disadvantages:
* Adds a custom non-standard extending technique
* Need to explain method in doco for adding sub-class data (via
"public"), vs. pointing the developer to an existing perl document.
* Doesn't work with multiple inheritance (probably not a big deal for
most RegistryCooker sub-class developers though)
Thanks for the summary Nathan,

Looking at it, I favor your original proposal, as then we have a complete control and any bugs are our own fault.

Considering that we go with that approach. Are there any in-core modules that can be used for creating/managing accessors? I know there is a whole lot of them on CPAN, but we don't want to create extra dependencies.

Another approach to simplify your original suggestion, is to move on to hash based objects. I doubt it'll be of any significant difference, since most work happens in the scripts themselves. I guess a benchmark will show better. But if we go with it, subclasses can simply bypass the accessors (we could just skip them) and work directly with the hash. Dunno, what's the best way to go.

__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to