Chapter Resources

Each chapter section here contains homework exercises, references, and additional links for demos and information for each chapter in the book - Distributed Systems: Architecture and Implementation.


Chapter 1 - Introduction

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

References

  1. The Eight Fallacies of Distributed Computing
  2. Putty and Bitvise SSH Client
  3. CyberDuck
  4. WinSCP

Additional Links

  1. Common Unix Commands
  2. FTP vs. SCP
  3. Sample file for ch1 homework
  4. Changing your gl prompt (optional)
  5. Advanced TCP/IP

Notes

  1. Check that you have your web directory (swe2019) activated. Go to http://swe.umbc.edu/~username (remember to replace username to your own UMBC account) and if you see a web page or a web directory browse, you are ok. If not, you need to activate your web directory by running this script.

Ch1 Exercise

Any time an exercise anywhere in the book asks you to put information into a file with a .txt extension, it must be a plain text file. Never use a word processor format. The bold item in the list of homework exercises always indicates what must be turned in for that homework assignment. Ask any questions on the blackboard forum.

  1. Do the following step-wise tasks:
    1. Login to your gl account using SSH to home (some details on ssh to gl is at ssh gl instruction).
    2. Navigate to your swe directory and stay there for the exercise.
    3. Create two text files named f1.txt and f2.txt and place some text in each using nano or other text editor.
    4. Get the meta.html file from my gl account using wget and save it in your swe directory.
    5. Rename the meta.html file to f3.html.
    6. Move the f1.txt file to your home directory and display a listing that shows it there.
    7. Display the f2.txt file on the screen.
    8. Copy the text transcript of all these tasks from the terminal screen and save it is a file called f4.txt in your swe directory.
    9. Display the f4.txt file one page at a time on the screen.
    10. Use a web browser to look at f3.html and f4.txt.
  2. Use SCP to copy a text or html file from your client machine to your swe directory. Look at that file in a web browser.

Chapter 2 - The Evolution of Distributed Systems

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

References

  1. None.

Additional Links

  1. W3Schools - This tutorial will be used throughout the book for reference on web technologies. This home page has links on the left for each topic. The following tutorials are referenced in chapter 2.
  2. Reference for xmllint.
  3. The shiporder.xml file.
  4. The shiporder.dtd file.

Ch2 Exercise

Ch2 Homework (hw1)

  1. Review the material for XML Basic and for DTD at http://w3schools.com. These are short readings that complement the discussion here in the book.
  2. Create a well-formed resume in XML for yourself or a fictional person. It should be very short but include tags for name, address, phone number, qualifications, at least three jobs, and at least 2 previous educational achievements. Save it as resume.xml and transfer it to your gl account in your swe directory. Note:
  3. Now make a DTD for a valid resume. Instead of using an external DTD as we did above, use an internal DTD and add it to your resume.xml file. An example of an internal DTD is at w3schools. Note:
  4. Validate your resume.xml file using xmllint on gl. Note:
  5. Go to the w3schools page on XHTML. Know its differences from HTML and XML. Check that it has the declaration for the XHTML DTD.

Chapter 3 - Web Technologies

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

References

  1. The W3C.

Additional Links

  1. W3Schools - The following tutorials are referenced in chapter 3.
  2. PostMan, you can use it for html method testing.
  3. JavaScript Demo
  4. PHP Demo
  5. CSV File for PHP Demo
  6. Source File for PHP Demo

Ch3 Exercise


Chapter 4 - SOAP

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

References

  1. SOAP at W3C.
  2. XMLSchema at W3C.
  3. XMLSchema for SOAP 1.1

Additional Links

  1. W3Schools - The following tutorials are referenced in chapter 4.
  2. The shiporder.xml file with XMLSchema, but no namespace.
  3. The shiporder2.xml file with XMLSchema and namespace.
  4. Modification of the ConverTemp example at UMBC.
  5. Online XML Validator - XSD (XML Schema).
  6. Another Online XML Validator - XSD (XML Schema).
  7. One more Online XML Validator - XSD (XML Schema).

Ch4 Exercise

Ch4 Homework (hw2)

  1. Recreate your resume XML document as valid using XMLSchema. This means that you will edit on top of the resume you created for hw1, and swap out the DTD for a reference to the new external schema file. This will require 2 files – resume.xml and resume.xsd. (Note: If your resume for hw1 is complicated, you can use a simplied version as long as it meets the requirements). The requirement differences between hw1 and hw2 are:
  2. Validate your new resume using xmllint. Look at the man page to verify your syntax as having this form: xmllint --noout --schema note.xsd note.xml. Unlike xmllint output for DTDs, the output for schemas is: 'note.xml validates' for the example above. Copy the xmllint command and output from the terminal screen and put it in a file called xmllint.txt.
  3. Use an online validator to validate your resume. Be sure that the validation succeeds for your namespace. Put the online validator url and the complete output in a text file called xsv.txt.
  4. Take a look at the above XMLSchema for SOAP. Remember that for standard schemas, you can use the namespace URL. Also remember that since schemas consist of all tags, you will have to view the source to actually see it. Find the XML subtree that defines the Fault complexType. Copy just that complex type to a text file called fault.txt.
  5. I have programmed a similar kind of program as in figure 4.6 using PHP. This PHP shows you details at a lower level (obviously, you would not want to give this to a real user!). You will be programming this kind of thing yourself on gl in chapter 10. Go to the following URL and and enter a line. You will see some PHP response detail and the actual request and response SOAP messages - examine them closely. Copy the request and response SOAP to a file soap.txt.
  6. Create an HTML TOC on gl for these chapter 4 homework tasks. It should show an ordered list where links 1-5 go to the files created in task 1-5. Put the single url to this TOC in the Blackboard assignment submission area.

Chapter 5 - WSDL

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

References

  1. WSDL at W3C.
  2. XSLT at W3C.

Additional Links

  1. W3Schools - The following tutorials are referenced in chapter 5.
  2. WSDL for the Shakespeare web service.
  3. SoapUI: A popular REST and SOAP Testing Tool.
  4. For-each XSLT example (Use 'View Page Source' option to see source code), The cd.xsl file
  5. Apply-Templates XSLT example (Use 'View Page Source' option to see source code), The cd2.xsl file

Ch5 Exercise

Ch5 Homework (hw3)

  1. Create an XSLT stylesheet for your XML resume that uses a client-side transform to display your resume using an HTML table. The table should list all the jobs in your Resume. The xml should include both xslt and xsd attributes like Ch5 Exercise. You should use the resume validated by the XMLSchema for practice with namespaces.
  2. Create an HTML TOC on gl for the hw from chapter 5 with the 1 link below (the toc will also include the links for chapter6 hw below).
    1. XML resume file (that calls the XSLT)

Chapter 6 - WS-*

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

References

  1. WS-Addressing at W3C.
  2. BPEL at OASIS.
  3. WS-CDL introduction and example.

Additional Links

  1. DocBook.
  2. DocBook Book (see chapter 2).
  3. XSL StyleSheets (download docbook-xsl-1.76.1.zip under docbook-xsl).
  4. Saxon (download the Saxon 6.5.5 zip version) - this is the java-based processor (it is an older version but ok for us). You only need the saxon.jar file, so you can unzip it on your pc and then just upload that file to gl or unzip it on gl and delete the extra files.

Ch6 Exercise

Ch6 Homework (hw3)

  1. Do this exercise with SAXON:
  2. Create an HTML TOC on gl with links for b-d above. Submit the single URL in the submission area on Blackboard. Your final HTML TOC will have 4 links (a-d), including the first one from chapter 5 above.

Chapter 7 - REST

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

References

  1. Fielding Dissertation (2000).
  2. JSON.
  3. CURL.
  4. Building Web Services the REST Way
  5. RESTful Web services: The basics
  6. www.programmableweb.com: A repository of web APIs, and has documented over 19,000 open web APIs and thousands of applications. Most of the open web APIs are REST web services.

Additional Links

  1. W3Schools - The following tutorials are referenced in chapter 7.
  2. JSON demo.
  3. HTML code in Guardian example, PHP code in Guardian example. The referenced PHP file is also saved with .txt so you can see the code.
  4. Flickr API.
  5. We will use the Flickr REST API to build a url to their photo service. This will require that you register on Flickr and get an API key. This is free, quick, easy, and typical of the REST services out there. All the information of what to do is in the documentation on the Flickr site, but you may find this tutorial or this one useful also.

Ch7 Exercise

Ch7 Homework (hw4)

  1. Implement the Guardian example from this chapter with a different query in the php. Also you need to show 2 additional variables from the guardian JSON in the html. You can decide on how to represent the result. You need to create the guardian.php for the application to call on gl. You now need an api-key for this as explained in the slides. Note that the javascript calls the php which uses curl to call the api to avoid cross-domain problems. You will end up with three urls to submit (one for Guardian html, one for guardian.php, one for guardian.txt showing the content of guardian.php).
  2. We will use the Flickr REST API to build a url to their photo service. Create the following URLs:
    1. Create a REST query for getHotList from the Flickr API documentation. You can see the REST url work from my gl account:
      =>curl -X GET 'https://api.flickr.com/services/rest/?method=flickr.tags.getHotList&format=rest&period=day&count=10&api_key=your_api_key'
      
      <?xml version="1.0" encoding="utf-8" ?>
      <rsp stat="ok">
      <hottags period="day" count="10">
      
      <tag score="100">feb23</tag>
      <tag score="97">whitenight</tag>
      <tag score="95">whitenightmelbourne</tag>
      <tag score="94">farligt</tag>
      <tag score="93">avstand</tag>
      <tag score="92">facedowntuesday</tag>
      <tag score="90">encuentros</tag>
      <tag score="90">whenigrowup</tag>
      <tag score="90">dp3merrill</tag>
      <tag score="90">whitenightmelb</tag>
      </hottags>
      </rsp>
              
      Or you could put the url directly in the browser address box.
    2. Create a REST query to search for all photos with a certain tag. You can choose the tag. Limit the results to 10 photos.
    3. Create a REST query to search for all public photos by a certain user reported in your last query.
    4. Create a REST query to search for the geo-location of a photo by a user reported in your last query (you do not need to put user id in query, just find a photo from the user from last query's result). You can do a query for a different user if your previous one had no geo-locations - just be sure to find one that does.
    5. You will now have 4 urls. Note the urls should be Flickr REST urls, not static urls.
  3. Create an HTML TOC on gl. It should include 7 items from tasks above. Task 1 has three links. Task 2 has four Flickr urls. Submit the single URL to your TOC in the submission area on Blackboard.

Chapter 8 - Distributed Systems Basics

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

References

  1. Caching Tutorial.
  2. Iterative and Recursive DNS Queries.
  3. IETF (maintains the DNS specification).
  4. OpenAFS.
  5. Websocket.org.

Additional Links

  1. Microservice Architecture.
  2. Microservices from Martin Fowler.
  3. Good overview single threading for Node.js.

Ch8 Exercise


Chapter 9 - Web Frameworks

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

References

  1. Design Patterns book by Gamma et al.
  2. SVG at W3C.

Additional Links

  1. CodeIgniter.
  2. Download CodeIgniter link - get old version 1.7.3.
  3. Demo scripts to download CodeIgniter on gl.
  4. unzip command.
  5. Webadmin for MySQL - web-based GUI.
  6. Example SVG image.
  7. PHP db reference that uses php4.
  8. First 'Hello World' CodeIgniter Video. See and implement this before doing the blog.
  9. Resume modification of first video in a gl account.
  10. Resume modification of first video with phone function.
  11. Second 'Create a Blog in 20 Minutes' CodeIgniter Video

Notes for CodeIgniter on gl

  1. Be sure and read these notes about the gl environment before doing work with CI. Since we cannot change the configuration of the web server, we must live with some gl defaults. If we had control, we could fix all this, but we do not.
  2. You must use the front controller 'index.php?' in all URLs (not 'index.php' as in the video). So a valid URL would be: https://swe.umbc.edu/~username/ci/index.php?/resume. Also, we cannot use .htaccess to get rid of the front controller because the apache rewrite module is not active on gl.
  3. Edit the config.php file for: $config['base_url'] = "https://swe.umbc.edu/~username/ci/"; and $config['index_page'] = "index.php?";
    Note that you will use your username and whatever you called your codeigniter directory.
  4. You will use the web tool to create db tables that is similar but differs from the one in the video. Use: https://mysql-admin.umbc.edu/phpMyAdmin. For server choice, choose studentdb-maria.gl.umbc.edu. There is no default id like in the video, so you create it. Make sure it is specified as the primary key using the first radio button on the right and is auto_increment using the drop-down.
  5. Remember that both your db name and username are your umbc username and you should change the password. The easiest way is to use the mysqladmin web app GUI.
  6. Since we are using a previous version of CI (version 1.7.3), there is a minor change from the video. The autoload.php entry is named 'libraries' (not 'core') as: $autoload['libraries'] = array('database');
  7. The hostname for database.php setting: $db['default']['hostname'] = "studentdb-maria.gl";

Ch9 Exercise

Ch9 Homework (hw5)

  1. Implement the Blog application from the second CI video tutorial 'Create a Blog in 20 Minutes' on gl. Note the URL for your Blog. Be sure and check out the UMBC environment notes in the on-line syllabus for chapter 9.
  2. Create an SVG file that contains a circle, a rectangle, and a line, each with a different color. Be sure to ditch the DTD and use the namespace. Save your SVG file on gl. Use your .svg file in an HTML file using the embed tag. Note the URL for your HTML file.
  3. Create an HTML TOC with links to both URLs. Submit the single URL for the TOC in the submission area on Blackboard.

Chapter 10 - SOAP Revisited

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

References

  1. NuSoap.
  2. C14n at W3C (Canonicalization.)
  3. Creating Web Services with PHP and SOAP. This is just another example very similar to the one in the chapter.

Additional Links

  1. Temperature Conversion Web Service Example from the lecture.
  2. cdStore simple example from the lecture.
  3. Modified ProductList. This is a modified version of the example in reference#3 implemented on gl.
  4. cdStore Refactoring Video Tutorial for hw6.

Ch10 Exercise

Ch10 Homework (hw6)

  1. Create a NuSOAP catalog server similar to the one in this chapter but using different products. Test it with a similar hard-coded PHP client that includes display of the the request and response SOAP. Hard-coded means that the client passes a static request. Note 1) the URL to this client and 2) the WSDL url of the service.
  2. Refactor the simple SOAP web service from the chapter to solve 4 problems:
    1. The client should not be hardcoded.
    2. The 3 arrays should be consolidated into 1 array and moved to a separate file.
    3. The web service should return an invoice in either html or json.
    4. A new web service function should return the catalog as an html table.
    A complete video tutorial on this refactoring shows how to use the given sample files at swe.umbc.edu. Note 1) the url to your working v2 application on gl and 2) the application web service WSDL url. Be sure to redundantly save each .php file as .txt so I can see the source code.
  3. Create an HTML TOC with links to the 4 URLs from tasks 1 and 2. All php files should be redundantly named with .txt so I can see the source code. Submit the single URL to this TOC into the submission area on Blackboard.

Chapter 11 - REST Revisited

Exercise and Homework

Homework due by Saturday, following the class noted on the syllabus schedule.

IMPORTANT - This has been updated to remove the Flickr exercises due to API changes.

References

  1. W3Schools - The following tutorials are referenced in chapter 6.
  2. Magpie . Do NOT download Magpie from the link. Use my modified version instead. Otherwise, you will run into error when parsing https RSS.
  3. PATCH.
  4. OmDb.
  5. RSS 2.0 Specification.
  6. Movie-Blogger RSS.

Additional Links

Notes

  1. If you ever have trouble with curl on the command line, place your url inside single quotes and try it again.
  2. Remember that the REST application is a live application. Do not go drunk and crazy and mess up my application database. If you want to play with mine, then create a new record, edit that record, and finally delete it.

Ch11 Exercise

Ch11 Homework (hw7)

  1. Do the final mashup demo from the class. Limit the output to 6 entries. Note the php and txt URL to your working mashup. I provided source code for mashup 'starter' and two demos (demo1, demo2) for this task (use .php for live working example). To avoid duplicate movies in the final list, the application only call omdbapi if the title of the movie item in the RSS ends with year surrounded by bracket, such as (2018). Also, you do not have to apply your own APIKey, using mine (1cdf8d38) is fine.
  2. We will implement a correct REST API for a simple model. We will not use codeigniter, but create our own rest api from scratch using php. The exact instructions for this item are inside the source code of the starter (the second last link from Additional Links).
  3. Create a HTML TOC with 5 links (#1 requires 2 URLs and #2 requires 3 URLs). Submit the single URL to your TOC in the submission area on Blackboard.

Chapter 12 - Semantic Web

Exercise and Homework

References

  1. Scientific American article by Berners-Lee et al. (2001).
  2. RDF at W3C.
  3. RDF Primer at W3C.
  4. RDFS at W3C.
  5. OWL at W3C.
  6. SPARQL at W3C.

Additional Links

  1. Original discussion on Linked Data
  2. foaf:
  3. Sparql Endpoints:
  4. SPARQL Examples
  5. DbPedia.
  6. Mondial.
  7. RDF to SVG web service.
  8. An OWL example for wine.

Ch12 Exercise