The learning goals for Week 46 are:
Mon: Broker I: Distribution and Remote Method Invocation. Wed: HTTP. Outlook to Java RMI.
Notes for this weekplan:
This week we switch to my new book "Flexible, Reliable, Distributed Software" that I am actively writing at the moment. It is about 90% complete (all that matters in this course has been written) and once you buy it, all future updates are free of charge (you can sign up to get an email when I publish revisions of the book).
Source code for Broker is open source at Bitbucket: FRDS.Broker Library.
Lab classes this week are not directly tied to a mandatory exercise delivery. Work on the exercises below in addition to working on next week's deliveries (iteration 9). I strongly suggest that you do the TeleMed exercise before you start on mandatory iteration 9. If you start on distributed HotCiv right away you will waste 5 hours understanding nothing, and then realize you should have understood the TeleMed system first :).
Clone the FRDS.Broker Library or download a ZIP of it. You need the 'master' branch.
- Skim the README file in the root which provides an overview of the subprojects (or better - read it on the BitBucket project page). The rest of this exercise is concerned with the 'demo' folder which holds the TeleMed system, described in FRDS.
- Start a socket based TeleMed server ('gradle serverSocket') in one shell/tab.
- Upload a bloodpressure measurement by running the home client ('gradle homeSocket') in another shell.
- Try Story 1: uploading various blood pressure values for various patients (explained in the README).
- Try Story 2: GP browses medical record, by using the fetch operation of the home client (explained in README).
- Study the code! Make a (informal) sequence diagram by tracing the call sequence for the stories above, from the HomeClient to the server and back again. In particular, study the ClientProxy and Invoker implementations - those are the ones specific for TeleMed.
- Study the server output! What is the JSON request and reply payloads, what are the parameters, how does it relate to the Broker theory, etc.
- If you have a gradle/java environment running on both M1 and on your host machine, you may try to run the server in M1 and the client on your host. It is explained in the README how to set the IP of the host.
Rehearse a broker exam situation. Spend 25 minutes to prepare a 10 minute oral presentation of an exercise in the example exam question set: demo-question-final-2018.pdf.
Next, do a 10 minute presentation at the whiteboard in front of your team.
The team provides constructive feedback on the presentation: Is your presentation clear and understandable, do you discuss the concepts and terms correctly, is you Java example code correct, etc. Swap and ensure all in the team gets a chance to rehearse the situation.
Try out Curl/Httpie/Postman
Next week, we will talk to web browsers using the commandline tool 'curl' or 'http'.
Try to retrieve web site pages using curl or http. Experiment with their verbose flags.
Build your own Web Browser
The EchoClient.java is from the Java Socket tutorial - it opens a socket connection to a named host and port and sends a single line of text, waits for a text answer, and then prints it.
Rewrite the EchoClient code so it sends a HTTP GET request to a specific web server, and prints the returned HTML, similar to how Curl or Httpie fetches web pages.
Legend: The typography bold, normal, (brackets), above indicate my perception of how important the exercises are from high to optional. However, solve the mandatory project first!.