I've played around with different approaches for the last few years and
have decided that the best way for me is have only accessors access the
data structures, even within the same module.  Even my constructors (of
my most recent code anyway) use the accessors.

Even though a lot of people would allow more flexibility within a
module, the older I get the more I value order and hygiene in my code.
As my code base grows and my working gray matter shrinks, I think I
reached this particular crossover point last year.
----------------------------------------------------------------------
Hey, check out http://www.mhook.com; all feedback will be appreciated



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
On Behalf Of Drew Taylor
Sent: Thursday, September 12, 2002 11:46 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [Boston.pm] Prototypes for object methods?


At 10:18 AM 9/12/02 -0400, Stephen Reppucci wrote:
>On 11 Sep 2002, Uri Guttman wrote:
>
> >       $self->{'fh'}->print( $text ) ;
>
>Directly accessing members of your object??? Ewww...!

I have always operated under the assumption that within a module/object 
it's OK to access members directly. Outside the module I always use 
accessors/mutators. What do others think?


--
Drew Taylor                | Web development & consulting
http://www.drewtaylor.com/ | perl/mod_perl/DBI/mysql/postgres
----------------------------------------------------------------------
"If you don't know what your program is supposed to do,
you'd better not start writing it."  -Edsger Dijkstra
----------------------------------------------------------------------
Speakeasy.net DSL - http://www.speakeasy.net/refer/29655

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm



_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to