Web-Based Data Transformation Using XML in Java
Dynamic, highly customizable platform independent web application acting as an intermediary among databases, utilizing XML, SOAP, HTTP, and Java Server Pages for data exchange.
Web-Based Data Transformation Using XML in Java
E N D
Presentation Transcript
WEB BASED DATA TRANSFORMATIONUSING XML, JAVA Group members: Darius Balarashti & Matt Smith
Idea • highly customizable • dynamic • platform independent Web application that acts as an intermediary among several databases in exchanging data
Background – technology used • XML • SOAP • HTTP • Java Server Pages (JSP)
XML - eXtensible Markup Language • called extensible since it is not a fixed format e.g. HTML • XML is a ‘meta-language’– a language for describing other languages - e.g. Wireless Markup Language (WML) • designed to describe any structured data • “universal format for structured data on the Web”– W3C web site When should I use XML? When you need a buzzword in your resume. W3SCHOOLS.COM
designed to describe data & focus on what data is No predefined tags No inherit structure of your tags used for data manipulation and transfer designed to display data & focus on how it looks Predefined tags Inherit structure built into tags e.g. <h1> used for displaying that same data XML vs. HTML XML is not a replacement for HTML
<?xml version="1.0"?> <CATALOG> <CD> <TITLE>EmpireBurlesque</TITLE> <ARTIST>Bob Dylan</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>Columbia</COMPANY> <PRICE>10.90</PRICE> <YEAR>1985</YEAR> </CD> </CATALOG> <html> <h2>Catalog</h2> <body> <table width=“100%”> <tr> <td>EmpireBurl</td> <td>Bob Dylan</td> <td>USA</td> </tr><tr> <td>Columbia</td> <td>10.90</td> <td>1985</td> </tr></table></body></html> Simple Example HTML XML • <?xml version="1.0"?> <CATALOG> <CD> <TITLE>EmpireBurlesque</TITLE> <ARTIST>Bob Dylan</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>Columbia</COMPANY> <PRICE>10.90</PRICE> <YEAR>1985</YEAR> </CD> </CATALOG>
Advantages of XML • data exchange between incomparable systems • Software independent • Hardware independent • plain text files • data is stored outside of HTML • can code documents more precisely • - reflects structure and semantics of that document
Transforming XML • DTD – document type definition - defines tags in XML - number, sequence, attributes, and values of those tags • XSL – eXtensible Style Sheet - browsers can’t display XML - transforms XML into HTML • CSS – Cascading Style Sheet - less control than XSL
SOAP – Simple Object Access Protocol XML and HTTP based Protocol -protocol for exchange of information decentralized environment - defines a framework for describing what is in a message & how to process it All SOAP messages encoded in XML
Java Server Pages (JSP) • servlet = server side applet - Java’s answer to CGI - no GUI • static HTML with dynamic content from servlets and/or JavaBeans • some Java advantages • Platform independent • Can utilize Java API for XML Processing (JAXP), Java API for XML Messaging (JAXM), and Simple Access API for XML (SAX).
XML & Java Application • XML document is parsed, data becomes available to application • DOM (Document Object Model) • represents elements as tree nodes • use if need random access to data • SAX (Simple API for XML) - fires events based on what it encounters - write code to make sense of these events
XML & Java • Java is portable code, XML portable data • Applications completely portable • Java provides most robust set of - API’s - processors - parsers
Why XML & JSP ? • can use SAX • 3 main steps • Create object model • Create parser • Create handler
Overall Approach • User can select source data and transfer it to different database(s) • 2 distinct process • - configuration • - transformation Web app. that is intermediary between 2 databases
Configuration Process • User driven - user selects source data - user selects destination database • User select transformation options, if any - direct mapping of data - string manipulations - simple calculations
System driven - takes user specified configurations and performs actual data transformation How? - System sends SOAP request to the module controlling the source database. - Module connects to database and receives the data tuple. - System sends data to the interpreter which transforms the data. - Data is sent to the module controlling the destination database. - Module loads the data into the database. Transformation Process
Costs • Time - done by April 2002 • Money – can vary greatly • Software - currently, none • Hardware - none other than available on campus
Performance Requirements • handle large databases 10,000+ records • less than 1 sec per record
Constraints • Environmental • Unknown bandwidth between system and source/destination • Unknown database optimizations • System • Bandwidth • Processor power • Code optimization
Constraints [cont’d] • User • Access Privileges • Security • Maintenance • Basic code/server maintenance • Updating database specific modules • Optimization
Alternative Designs • Application server using Enterprise Java Beans • Adv: any application environment, direct transformations • Dis: complex, expensive, unreliable • Microsoft .NET platform • Adv: based on XML, any language • Dis: documentation, Beta version
Testing Methods • User Interface Testing Testing Methodology: Rational Unified Process Testing the user interface against necessary functionality. • Unit Testing Testing the classes as individual components. Development and implementation of test cases. • System Testing Testing the classes as components in the system. Development and implementation of test scenarios.