perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Wiles <fr...@wiles.org>
Subject Re: Using OO with mod_perl correctly to avoid leaks
Date Fri, 22 Dec 2006 19:11:49 GMT
On Fri, 22 Dec 2006 11:23:22 -0600
Boysenberry Payne <boysenberry@humaniteque.com> wrote:

> Is this bad usage?
> 
> Am I creating the same situation using inside-out classes seek to
> avoid, i.e. accessing object internals directly via manipulating  
> $definitions_of{ident Habitat::Definitions}?

  In short yes.  It's not the entire goal of inside-out objects to 
  hide direct access to the data, but it is a big part of it. 

  Just create a three methods in your object to access the data
  you want.  Based on what you sent I think you'll need 
  server_user(), servers() and real_habitat() methods. 

> Is this kind of structure still prone to leak memory?

   Huh?  I'm not sure what you mean by this, in general if you
   aren't doing anything crazy with circular references or closures it
   is very very difficult to "leak" memory. 
  
> What are the ramifications of not returning the $self blessed
> reference?

   The ramification is that your inside-out objects won't work.  
   All you've managed to do with this code is create a really 
   complicated way of making, populating, and returning a
   hash. 

 ---------------------------------
   Frank Wiles <frank@wiles.org>
   http://www.wiles.org
 ---------------------------------


Mime
View raw message