Mercurial > pub > Impl
diff Lib/IMPL/Class/PropertyInfo.pm @ 134:44977efed303
Significant performance optimizations
Fixed recursion problems due converting objects to JSON
Added cache support for the templates
Added discovery feature for the web methods
author | wizard |
---|---|
date | Mon, 21 Jun 2010 02:39:53 +0400 |
parents | b0c068da93ac |
children | 6ce1f052b90a |
line wrap: on
line diff
--- a/Lib/IMPL/Class/PropertyInfo.pm Fri Jun 18 16:27:28 2010 +0400 +++ b/Lib/IMPL/Class/PropertyInfo.pm Mon Jun 21 02:39:53 2010 +0400 @@ -20,9 +20,7 @@ sub Implementor { my $this = shift; - - my $implementor; - + if (@_) { $this->SUPER::Implementor(@_); } else { @@ -32,26 +30,16 @@ $implementor = $this->SelectImplementor(); if (my $class = ref $implementor ? undef : $implementor) { - if (not $LoadedModules{$class}) { - (my $package = $class.'.pm') =~ s/::/\//g; - require $package; - $LoadedModules{$class} = 1; - } + eval "require $class; 1;" or die $@ unless $LoadedModules{$class}++; } $this->Implementor($implementor); - return $implementor; } } sub SelectImplementor { - my ($this) = @_; - - if ($this->Class->can('_PropertyImplementor')) { - return $this->Class->_PropertyImplementor; - } - die new IMPL::Exception('Can\'t find a property implementor for the specified class',$this->Class); + eval {$_[0]->Class->_PropertyImplementor} or die new IMPL::Exception('Can\'t find a property implementor for the specified class',$_[0]->Class); } 1;