Title: Message
object.getEncapsulatedObject().function()
 
that inner object is no different from any other data member of the parent CFC.  It still needs a getter method for all access.
 
However, a better design is probably to hide the inner object completely, and just call a method of the parent object, which in turn calls the inner object.  That way if you decide you want to use a different inner object, multiple inner objects, or just implement all the functionality in the parent object, the code that uses the parent object won't have to change.  That's the real benefit of encapsulation. 
 

---
Barney Boisvert, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Paul Johnson
Sent: Wednesday, August 06, 2003 4:40 PM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Encapsulation with unamed scope

So,
 
I have been watching the chat on the various lists about cfc's. I agree that using the private scope seems to make sense. I guess you just have getters and setters for all variables.
 
Question: I was just wondering how you go about using encapsulation in this case. I have implimented code using Hal Helms book (Cold Fusion MX Components) and I have addressed encapsulated objects thus
 
object.encapsulatedObject.function()
 
How do you achieve this when using private vairables from a page?
 

Cabbage Tree Creative Ltd.
Paul Johnson 
web programmer
Phone    +64 3 377 7544
Email     [EMAIL PROTECTED]
Web      www.cabbagetree.co.nz

manage your own web site with Thrive - contact us to learn how!

 

Reply via email to