[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Using OO with mod_perl correctly to avoid leaks
From:       Frank Wiles <frank () wiles ! org>
Date:       2006-12-22 19:11:49
Message-ID: 20061222131149.6347893e.frank () wiles ! org
[Download RAW message or body]

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
 ---------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic