Data hiding is indeed encapsulation. There are may types of encapsulation: data hiding, implementation, object creation, and system design. NetObjectives has a very nice article on using different types of encapsulation to identify patterns:
http://www.netobjectives.com/ezines/ez0508NetObj_IDPatternsTermsEncap.pdf And just a note that you if you don't want to have to write getters and setters for every property, you can still make the variables private rather than public by creating a single get method that gets any property: getProperty( 'firstName' ). This way you only have one method, but external code can only change the properties if you allow them to (by going through a setter). Regards, Brian On 8/31/05, Joseph Flanigan <[EMAIL PROTECTED]> wrote: > THIS scope variables simply mean the variable is a public memory structure. > Every CFC has a public memory structure. For the most part, these are > either functions or variables spaces that can be accessed by a calling > application. > > A CFC itself defines an encapsulated memory structure. Its definition is a > potential instance of an object. Encapsulation is a design decision. Data > hiding is not encapsulation. The common technique for implementing data > hiding is using getter and setter functions to access private > variables. Getter and setters can be used to very effectively on public > variables just as well as private variables. (See table wrapper CFC > generated by CFSQLtool for practical examples.) > > If an application has overloaded use of a CFC for data type changes, getter > and setter are worth considering. Some examples of OO overstate > encapsulation to include data hiding. Which is fine as long as the meaning > is obvious. Data hiding may be useful when functions are overloaded. > > Public variables are practical. For me, CFC public variables are very > productive. Once a memory structure is instanced as an object, it's > structure is well defined. Instances of public variables are easy to > reference by simple assignment whereas to reference private variables > requires get and set functions. > > Some descriptions of "encapsulation" may better described as overloading. > For example, a function that calculates price of gas can be overloaded with > volume types of either gallons or liters. > > > > ----------------------------------------------------------------------- > http://www.switch-box.org/CFSQLTool/Download/ > > Switch_box MediaFirm, Inc. > www.Switch-box.org Loveland, CO USA > > > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email to > [email protected] with the words 'unsubscribe cfcdev' as the subject of the > email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting > (www.cfxhosting.com). > > CFCDev is supported by New Atlanta, makers of BlueDragon > http://www.newatlanta.com/products/bluedragon/index.cfm > > An archive of the CFCDev list is available at > www.mail-archive.com/[email protected] > > > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). CFCDev is supported by New Atlanta, makers of BlueDragon http://www.newatlanta.com/products/bluedragon/index.cfm An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
