> The "ideal" solution is to use a data transfer object (DTO). It's a > lightweight version of your BO, that only has getter methods. It takes a BO > memento upon construction, but provides no way to modify it, so it can be > safely passed to the view components. The downside here is that you have to > duplicate the getter methods in the BO and the DTO, but that's a small price > to pay to keep the encapsulation unbroken. I think you might even be able > to dynamically construct a DTO with the BO's getter methods (assuming CFCs, > of course), and save yourself the duplication, but I'm not sure about that.
If your DTO is so lightweight, then why bother having any getter methods. It would seem that your controller or data manager could call any calculating functions in your BO and send the results as part of the structure to your view. I certainly understand encapsulating your BO's, but is there really any need for a DTO being sent to a view? ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
