XML for COOL Plex the patterns and a























- Slides: 23

XML for COOL: Plex - the patterns and a customer example Christian Ernstsen Websydian Product Development Soft Design A/S christian. ernstsen@softdesign. dk

Agenda Where does XML fit into the Plex problem domain ? Modelling the structure of XML documents The Transac. XML patterns A customer example – price and quote system in the B 2 C insurance market

XML and Plex is build for transaction based systems on relational databases This is the focuspoint for Transac. XML Plex and Transac. XML – Where structured relational information must be interchanged with business partners Used where Business Logic: – Produces and sends a XML document – Receives and processes a XML document

XML and Plex XML solves a number of interchange problems – Structure by Schema’s or DTD’s – Parsers using DOM interfaces However… – A number of new technologies to learn – A lot of lines of code has to be written => risk Plex and Transac. XML …. – Isolates the underlying technologies – By skills integration reduces risk and enables faster time to market.

Business Data Interchange Data Data Connection Comm. Protocol Definition Representation Recognition Processing Conventional EDI ü VAN Operator Dependent ü ASC/X 12, UN/EDIFACT ü ASN. 1 ü Implementation Dependent ü Business Logic Dependent A lot of good and proven solutions, however these technologies are ”store and forward” technologies and very costly.

Business Data Interchange Transactional XML Data Data Connection Comm. Protocol Definition Representation Recognition Processing ü The Internet - TCP/IP ü HTTP ü XML Schema / DTD ü XML Document ü XML Parser ü Business Logic Dependent WEBSYDIAN ENTERPRISE TRANSACXML

XML example Belgian Waffles, $5. 95, two of our famous Belgian Waffles with plenty of real maple syrup, 650 Strawberry Belgian Waffles, $7. 95, light Belgian waffles covered with strawberrys and whipped cream, 900

XML example

XML Parser Parse process interprets the document in a tree structure XML parsers are build for all major SW implementations XML parsers have a well defined interface – DOM (Document Object Model)

Tree of brekfast-menu

Set xml. Doc = Create. Object("microsoft. xmldom") xml. Doc. load("c: breakfast-menu. xml") Set root = xmldoc. document. Element Set node. List = root. child. Nodes Set food = node. List(0) Set name = food. first. Child Set text. Node = name. first. Child Set name. Text = text. Node. node. Value Set price = name. next. Sibling Set text. Node = price. first. Child Set price. Text = text. Node. node. Value Set description = price. next. Sibling Set text. Node = description. first. Child Set description. Text = text. Node. node. Value Set calories = description. next. Sibling Set text. Node = calories. first. Child Set calories. Text = text. Node. node. Value This code is without any errorhandling – it is just to show the basic steps of traversing a tree using DOM.

DTD example <!ELEMENT breakfast-menu "food+"> <!ELEMENT food "name, price, description, calories? " <!ELEMENT name "#PCDATA"> <!ELEMENT price "#PCDATA"> <!ELEMENT description "#PCDATA"> <!ELEMENT calories "#PCDATA">

Model of the structure in Plex <!ELEMENT breakfast-menu "food+"> <!ELEMENT food "name, price, description, calories? " <!ELEMENT name "#PCDATA"> <!ELEMENT price "#PCDATA"> <!ELEMENT description "#PCDATA"> <!ELEMENT calories "#PCDATA">


The Transac. XML patterns Set xml. Doc = Create. Object("microsoft. xmldom") xml. Doc. load("c: breakfast-menu. xml") Read services: – Single. Fetch – Flat. View – Process. Group Update/Insert services: – Insert. Row. And. Attach – Update. Row – Delete. Row Set root = xmldoc. document. Element Set node. List = root. child. Nodes Set food = node. List(0) Set name = food. first. Child Set text. Node = name. first. Child Set name. Text = text. Node. node. Value Set price = name. next. Sibling Set text. Node = price. first. Child Set price. Text = text. Node. node. Value Set description = price. next. Sibling Set text. Node = description. first. Child Set description. Text = text. Node. node. Value Set calories = description. next. Sibling Set text. Node = calories. first. Child Set calories. Text = text. Node. node. Value Skills integration through reuse of Plex koncepts

Customer example LB (Lærerstandens Brandforsikring) – Insurance company – Users of Plex for 4 years – Business processes as components written in Plex Insurance broker – ”Forsikringsluppen” – Visibility into the insurance market-place – Portal with insurance quotes for all participating insurance companies – Portal implemented using XML – LB first company ready to paticipate

LB’s XML applications Insurance Portal Customer (Browsers) Internet XML application reusing Websydian applications Plex application made as component Firewall Websydian applications Web server Customer (Browsers) Corporate Database

Transac. XML Document generator XML Response document Transac. XML Document handler Transac. XML Dispatcher Portal HTML End-user Web-browser XML Request document





References - links www. lb. dk www. forsikringsluppen. dk www. websydian. com Questions