
Quick vs. Powerful - How To Generate AngelXML
For developers who want to work with Transaction Pages to access their internal systems but have never worked with XML, the solution is to write an http accessible interface that can output AngelXML.
The first thing to realize is that unless you are stuck with older languages such as FORTRAN or COBOL, the programming language you have is probably sufficient. If know how to output an html interface that mimics the business logic, then you'll be able to output an AngelXML and have a voice-accessible interface in short-time.
There are two recommended approaches, the template approach and the integrated approach. The template approach separates out business logic from presentation logic, which is ideal when multiple means of access must be provided to the same business logic (such as a web-form and voice). The integrated approach uses the business logic or functions to directly generate XML. This can frequently be used to get things out the door quickly, or to allow for more complex decisions in the XML rendering logic.
The template approach is a catch-all term that can encompass a gamut of design patterns such as the Model View Controller (MVC) and The JavaServer Pages Model 2 architecture, and functionality such as heredocs in Perl or PHP. The underlying theme with any of the approaches is to separate out business logic from presentation.
The integrated approach ties the presentation to the business functions. This may be a more rapid way to get code out when there are not other existing presentation layers for the same business logic. It also can allow for more complex logic to drive the creation of presentation layers. Use of technologies such as JAXP can allow a developer to use object-oriented techniques such as polymorphism and encapsulation to generate AngelXML. C# in particular has XML Serialization that allows one to easily map objects to an XML format.
Object-oriented scripting languages such as Perl and PHP are ideally suited for producing text-based interfaces such as HTML or AngelXML. The PHP code below has individual classes that know how they should be rendered, so that the top-layer code does not need to be aware of the objects internal structures, but still allows the use of template features so that the code is not a mess of print statements.
If you're working on an IVR project we'd love to talk to you! Give us a call at 888-692-6435 and say "Developer Hotline".
Sam Aparicio
