Scott -

In my experience, using get and set methods (accessor and mutator
methods) within an Object is the way to go.  It means that you can
control how much access that a particular property can be utilised.

A cute trick (one I don't like, but it is cute never the less) is to use
overloading and have it so that - 

Obj.monkeyLuva() - returns the property
Obj.monkeyLuva(true) - sets the property.

Capish?

Now dumb question - how are you setting properties in your CFC? Or is
this some other kind of object?

Mark


--
[EMAIL PROTECTED]
ICQ: 3094740
 
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott
Barnes
Sent: Saturday, 1 March 2003 11:47 PM
To: CFAussie Mailing List
Subject: [cfaussie] OOP / Data Hiding / Data Encapsulation..

Oooh new buzz word for our dictionaries "encapsulation".

Seriously, I've been reading more and more on Do's / Don'ts of OOP
programming across C# and Java, and I'm trying to gauge as to whether or
not
accessing instantiated properties or properties within an Object should
ALWAYS have the setter/getter methods.

i.e.
<cfscript>
    myObj.monkeyLuva = "true";
</cfscript>

as opposed to:
<cfscript>
    myObj.setMonkeyLuva("true");
</cfscript>

Which then fires a method within the object, to set the this.monkeyLuva
=
arguments.sString;

What's peoples thoughts on this, and what would be a general rule of
thumb
when approaching this? especially if you have loads of properties for an
Object..

Regards
Scott Barnes






---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to