[DCPM] Inside-out object accessor

Darke, Clive Clive.darke at qa.com
Tue Apr 4 04:06:17 PDT 2006


> You're going to have to explain tht a bit more for me before I 
understand why it's good :) 

OK.  The basis of inside out objects is that the attributes are held in
lexical hashes, one per attribute.  For example %name, %address, etc.  The
key to the hash is a stringified reference - any old reference so long as
its unique.  This reference is used as the blessed object.
 
Normally I would create a get or set type subroutine for each attribute,
get_name(), set_name(), get_address(), set_address(), etc.  This can be a
lot of tedious code to maintain.  However this accessor covers any number of
attribute hashes.  It seems so simple to me that I just know there must be a
drawback, though I can't see one (except that it might need a truck load of
comments).
 
Clive


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/devoncornwall-pm/attachments/20060404/56f979c2/attachment.html


More information about the Devoncornwall-pm mailing list