Doug MacEachern wrote:
> in more detail.. here are the issues i see with the current
> implementation of script cache and symbol table entries:
> 
> 1) cache location is not flexible.  forces creation of a
> global variable with the same name as the subclass:
> 
>  no strict 'refs';
>  ${ $o->[CLASS] }->{ $o->[PACKAGE] }->...
>  #for example creates a global '$ModPerl::Registry' hash reference
> 
> default should be like 1.x, where cache is under 1 "root" rather
> than caches scattered around the symbol table.
> 
> each subclass still has its own package namespace in the Perl symbol
> table.  but this the list of all packages can be accessed from 1 "root".
> 
> to make this flexible, RegistryCooker should have a cache_table
> method, for example:
> 
> #the default
> sub cache_table {
>     \%ModPerl::Registry; #or whatever name
> }
> 
> if a subclass wants to keep the cache in its own package, it can do:

but then it ends up not under 1 "root"

> #example based on what the current RegistryCooker forces
> sub cache_table {
>     my $self = shift;
>     my $class = ref $self;
>     no strict 'refs';
>     \%$class;
> }

> 2) symbol table location is not flexible.  forced into %$SubClassName::Cache.
> 
> default should be like 1.x, where scripts are compiled under 1 "root"
> namespace.
> 
> Apache::ROOT::
>  vs.
> {{ModPerl,MyClass,YourClass}::{Registry,RegistryBB,Foo,Bar}}::Cache
> 
> not sure if that matters as much.  but i don't see what is gained by
> spreading these out underneath the subclasses.  would still prefer one
> top-level hardcoded root with everything under it.  kinda like how
> Perl has one top-level hardcoded root (%main::)

the gain I see is that now in Apache::Status, you can see groups of 
caches by their registry module.

How about using your suggestion, but fork below the top-level hardcoded 
root:

Apache::RegistryCache::{Registry,RegistryBB,Foo,Bar}}::

now you can start traversing from Apache::RegistryCache

I prefer Apache::RegistryCache to Apache::ROOT for the root's namespace. 
  Do we have to keep compatible with 1.x?

Also to avoid confusion, I'd rather stay in ModPerl:: namespace, so my 
best choice is ModPerl::RegistryCache.

__________________________________________________________________
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