TUTORIAL 4 Ajax Patterns, XML and JSON by zwj23860


									SECC402: Rich Internet Applications

TUTORIAL 4: Ajax Patterns, XML and JSON

Question 1
What category is each of the following Ajax patterns classified under in

   a) XML Message
   b) XMLHttpRequest
   c) HTML Message

Question 2
Explain the role of each of the following in an Ajax pattern description:

   a)   Developer story
   b)   Problem
   c)   Forces
   d)   Solution

Question 3
Write the data contained in the following XML document as JSON text:

       <title>AJAX, Rich Internet Applications, and Web Development</title> 
               <author name=”Paul Deitel” /> 
               <author name=”Harvey Deitel” /> 
       <publisher>Prentice Hall</publisher> 
               <review rating=”4”>A great book</review> 
               <review rating=”5”>A very useful book</review> 
               <review rating=”3”>Pretty good</review> 

                                                                            please turn over

                                           page 1
 SECC402: Rich Internet Applications

 Question 4
 Write the data contained in the following JSON text as XML using (a) elements and (b)

                “captain”:”Modesto VAZQUEZ”, 
                “players”:[“David NALBANDIAN”, “Juan MONACO”, “Juan Ignacio CHELA”,  
                   “Lucas ARNOLD‐KER”] 
                “captain”:”Albert COSTA”, 
                “players”:[“Rafael NADAL”, “David FERRER”, “Tommy ROBREDO”,  
                   “Feliciano LOPEZ”] 
                “captain”:”Bogdan OBRADOVIC”, 
                “players”:[“Novak DJOKOVIC”, “Viktor TROIKI”, “Janko TIPSAREVIC”,  
                   “Nenad ZIMONJIC”] 

 Question 5
 You are part of a development team creating an RIA, and you have decided to use Ajax.
 Your team now needs to decide on a message format to use for sending data from the
 server to the browser. To help make the decision, make up a decision matrix in which
 you lay out the criteria and the options in a table, and give each option a rating from 1 to
 5 for each criterion. The matrix should look something like this:

                      performance      ...
 HTML message              5                 ...
 ...                      ...

                                                   page 2

To top