Hi Mike
Yes, you would just call getMessageXML() and the builder would return the complete XML message. The XML tags would be output in the same sequence that they were added. If you introduce message specific components, they would be used to ensure the set of added tags were valid for that message. Specifically, a message specific component would also have a function getMessageXML() which would first validate that a title and the correct set of tags were added, then it would call the builder's getMessageXML() and return it's result. Also, if the message specific components were created, they would not be child components of the builder - they would be standalone components (if you are on CF8 they could all implement an interface - cfinterface). Regards Kevan _____ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Dawson, Michael Sent: Sunday, 11 May 2008 1:55 AM To: [email protected] Subject: [CFCDEV] Re: Appropriate Use of Parent Object Let me see if I get this correct... Here is some more background on the Cisco phones. Each response can contain only one very-well-formed XML packet. There is no HTML allowed. The phones will reject any "extra" XML tags/attributes that are not in the XML definition for any given response. There are around a dozen CiscoIPPhonexxx XML responses that the phones will accept. However, I will probably only use four of those types. The other types are for more-expensive phones that we do not have. The four types of responses are: CiscoIPPhoneText, ...Menu, ...Input, ...Directory Now, you are suggesting that I create a single component that can generate any one of the four XML responses that I need? This single component will contain all functions even if I don't need all of them for any given XML response? OK. With that, how/where would I put the appropriate pieces together to create the XML response? Would I have functions such as: getMessageXML("Text") getMessageXML("Menu") and so on Or would I have functions such as: getTextXML() getMenuXML() and so on Or do I just call getMessageXML() and have it put together the XML based on any component instance variables that have been populated? For example: setTitle("Title goes here") setPrompt("Prompt goes here") setText("Text goes here") addMenuItem("Name", "URL") addMenuItem("Name", URL") getMessageXML("Text") Thanks! _____ From: [email protected] on behalf of Kevan Stannard Sent: Sat 5/10/2008 7:21 AM To: [email protected] Subject: [CFCDEV] Re: Appropriate Use of Parent Object Hi Mike The idea behind parent objects in inheritance is that parents are more "generic" or "abstract" versions of the children, rather than strictly being a collection of functions to share with the children. Another idea for you to consider - create a component called CiscoIPMessageBuilder.cfc. This would contain all of the possible functions required to build all possible messages: - setName() - addTitle(title) - addPrompt(prompt) - addMenuItem(name,url) - ... - getMessageXML() - returns the XML based on the added tags. You would need to create a new builder object each time a message was required. If needed, you could create separate components for each message type which would then use the builder to do the actual XML construction. Regards Kevan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en -~----------~----~----~----~------~----~------~--~---
