I have worked with thins since Apple released their first Object Pascal. I have watch broker/agent techniques evolve. At the same time GUI systems have been changing, always getting better. I guess the term for that nowadays is "refactoring".
At some point a method is basically a procedural behavior wrapped up in the syntax of some language. Best experience....not sure there is a easy way to decide that. Perhaps the best way for me has been Anti-Patterns. First professional program I worked on was FORTRAN Code with a single variable, using the miracle of equivalenced common blocks. And fer-sure, that was an Anti-Pattern. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Elmore Sent: Monday, January 17, 2005 11:05 PM To: [email protected] Subject: RE: OO Purity or Overkill Hey Jack, I see what you mean about needing a broker. I know in Java everything is a class and so one of objects needs to be the initiator of some action. But from looking at CF OO it seems like a lot of folks are still using procedural action files to get OO communication going. I don't know what is proved best from experience though. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jack Lavender Sent: Monday, January 17, 2005 10:47 PM To: [email protected] Subject: RE: OO Purity or Overkill The singleton object needs to be known wherever you want it to be used. Its public behavior is that reference. I am not the best guy to comment on "create the object to know nothing about the outside world", but that doesn't make sense to me. Probably 'cause it is late and I am doing a lot of systems work. When object "interact", then something must act as a broker for that interaction to take place. containership and inheritance are used for building some kind of "relationship". But to try to force some "overarching" relationship structure can really be painful, and the Singleton object gets around that pain. Singletons can be overdone, like any other technique. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Elmore Sent: Monday, January 17, 2005 10:31 PM To: [email protected] Subject: RE: OO Purity or Overkill That's how I'm using the singleton object. What I'm curious about is best practices in referencing the singleton from within other objects. Normally you create the object to know nothing about the outside world, but it seems like in this case it might be overkill. Thanks -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jack Lavender Sent: Monday, January 17, 2005 10:26 PM To: [email protected] Subject: RE: OO Purity or Overkill I have no idea how the OO stuff in Cold fusion works. No contract to do so, so have not taken time to do it. But the singleton pattern gives you one and only one of these objects in your application by making the constructor private and provided a "static" function that gives access to the allocate object on the heap. Or I should say I have done this per the GoF (Gang of Four) Singleton Design Pattern in both Java and C++. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Elmore Sent: Monday, January 17, 2005 9:57 PM To: [email protected] Subject: OO Purity or Overkill I'm working on my first OO application and wanted to make sure I wasn't breaking any OO doctrines. I have a singleton object loaded into the application scope which has settings that tell many of the other objects what to do. So, would it be so bad to reference that singleton directly in the other objects. Like: application.singleton.getSomeValue(), or should I pass in a copy of the singleton to the other objects and let them work from it within the arguments scope. I would really appreciate your experience and words of wisdom. Thanks Daniel Elmore ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm
