TUTORIAL 4 Ajax Patterns, XML and JSON by zwj23860

VIEWS: 5 PAGES: 2

									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
ajaxpatterns.org?

   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:

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




                                                                            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)
 attributes

 {daviscupteams:[ 
               {“country”:”Argentina”, 
                “ranking”:”4”, 
                “captain”:”Modesto VAZQUEZ”, 
                “players”:[“David NALBANDIAN”, “Juan MONACO”, “Juan Ignacio CHELA”,  
                   “Lucas ARNOLD‐KER”] 
               }, 
               {“country”:”Spain”, 
                “ranking”:”2”, 
                “captain”:”Albert COSTA”, 
                “players”:[“Rafael NADAL”, “David FERRER”, “Tommy ROBREDO”,  
                   “Feliciano LOPEZ”] 
               }, 
               {“country”:”Serbia”, 
                “ranking”:”12”, 
                “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:

           criteria
                      performance      ...
options
 HTML message              5                 ...
 ...                      ...




                                                   page 2

								
To top