WDDX Case Study: Building a Cross CFUG Search - PowerPoint PPT Presentation

About This Presentation
Title:

WDDX Case Study: Building a Cross CFUG Search

Description:

Local server parses query results, stores each parsed record in a database, to ... News feeds. http://cfug.itcenter.org/ - Greg Witte's Digital Daily ... – PowerPoint PPT presentation

Number of Views:99
Avg rating:3.0/5.0
Slides: 15
Provided by: aprilf1
Category:
Tags: cfug | wddx | building | case | cross | daily | local | news | search | study

less

Transcript and Presenter's Notes

Title: WDDX Case Study: Building a Cross CFUG Search


1
WDDX Case Study Building a Cross CFUG Search
  • April Fleming

2
Introduction
  • Real world WDDX (not just a short introduction)
  • Problem I encountered developing an application
  • How I used WDDX to solve the problem
  • Benefits of using WDDX

3
Scenario
  • Data stored on 3 separate servers across the
    country
  • Using CFHTTP to access remote server
  • Remote server built query searching all fields on
    criteria entered by user.
  • Remote server performs query, outputs the query
    results with a set of predetermined display
    fields
  • Local server parses query results, stores each
    parsed record in a database, to be used and
    displayed.

4
Problem
  • Parsing routine had to be written
  • If remote server output changed the parsing
    routine would no longer work until it was
    modified.
  • Required strict communication/cooperation between
    nodes, not practical
  • Needed to allow user to search on any given
    field, using logical operators
  • EX FirstName contains A and FirstName
    contains B
  • Needed knowledge of data on remote server to
    avoid rewriting the parsing routine if the remote
    server changed its structure
  • Needed to allow user to specify any or all fields
    to display in search results in any given order.
  • Needed knowledge of data on remote server to give
    user all possible return fields
  • Local parsing routine needed to be able to parse
    any possible combination of fields returned by
    remote server.

5
Problem - contd
  • Storing Search Results
  • Needed to be able to store any given set of
    fields in any order
  • Current storage of search records to local table
    could not accommodate
  • If we stored return fields as text, could not
    access them as a recordset
  • Individually inserting records into the database
    was processor intensive and very slow.
  • All of the writing and reading from the ACCESS
    database were causing it to be corrupt.

6
Solution
Enter WDDX.
7
What is WDDX?
  • WDDX is a tag Markup language written in XML.
  • The markup language describes the data which is
    being marked up
  • Serialization and Deserialization functions
    written for CFML, ASP, JavaScript,Java, PERL, and
    Python
  • Facilitates passing objects
  • Recordsets
  • Arrays
  • Structures

8
WDDX Tag
  • ltCFWDDX ACTION""
  • INPUT""
  • OUTPUT""
    TOPLEVELVARIABLE"gt
  • ACTION
  • CFML2WDDX - Serialize to WDDX Format
  • WDDX2CFML - Deserialize WDDX to CFML
  • CFML2JS - Serialize CFML to Javascript
  • WDDX2JS - Deserialize WDDX to Javascript
  • INPUT - Data to be Serialized/Deserialized
  • OUTPUT - Output variable for Serialized/Deserializ
    ed Data
  • TOPLEVELVARIABLE - Output variable for Javascript
    Object

9
Terms
  • Serialize - converting data to WDDX format
  • Deserialize - extracting data in native language
    format
  • Packet - serialized data

10
WDDX In Action
  • Had the remote server output a WDDX packet
    describing their data
  • Does not matter what language they use
  • Used ltCFWDDXgt to deserialize their packet
  • Was able to output over the deserialized query to
    create form for users to choose the fields they
    want to search
  • Used ltCFWDDXgt to serialize a structure containing
    search criteria.
  • Remote server outputs search results in packets
  • Local server deserializes results packets and
    manipulates as if queries had been run locally

11
WDDX In Action - Contd
12
Benefits
  • Parsing routine was already written, performed by
    WDDX tag
  • Remote server could return any data, WDDX packets
    are self-describing
  • User could specify any fields since parser could
    now parse any fields returned.
  • Packets could be written to files, or entire
    packets could be stored in database requiring
    less load on the database.
  • Surprisingly fast!

13
Other Uses for WDDX
  • Syndication
  • Stocks quotes
  • News feeds
  • http//cfug.itcenter.org/ - Greg Wittes Digital
    Daily
  • Using JavaScript to allow for multiple user input
    for a given field
  • Parent/child relationship
  • Multiple phone numbers
  • Transferring Data from Browser to Server
  • Wizard interface
  • Maintain state in an inherently stateless medium

14
Resources
  • http//www.wddx.org/
  • http//www.allaire.com/developer/
  • http//www.xml.Com/
  • Advanced ColdFusion 4.0 application development
    (ISBN 0-7897-1810-3)
  • Advanced ColdFusion development
  • XML journal (http//www.coldfusionjournal.Com/)
Write a Comment
User Comments (0)
About PowerShow.com