|
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.
---
|
Title: Message
- [CFCDev] Encapsulation with unamed scope Paul Johnson
- Barney Boisvert
