rolandweber / Pityoulish

A collection of programming/debugging exercises to support a course on Distributed Systems.
Creative Commons Zero v1.0 Universal
7 stars 0 forks source link

Prevent hard-coding of server name or IP #39

Closed rolandweber closed 6 years ago

rolandweber commented 8 years ago

During the classroom exercises (Sockets, Java RMI), students could hard-code the server name instead of using the respective command-line argument, without encountering an error. With just one server machine in the network this is hard to prevent.

Improve the comments in the code? Change the server IP address during the exercise? Run two servers in parallel?

Detected during Sockets exercise 2016 (#38).

rolandweber commented 7 years ago

Running two servers in parallel makes sense. Preferable when there are two server implementations. For the socket exercise, the second server could be in a different programming language. Or one with blocking IO and the other with asynchronous NIO and connection keep-alive.

Some ideas on how to integrate this into the classroom exercises:

  1. Run two servers on different ports of the instructor's machine, or have two instructor machines in the network. Let students test every step against both servers.
  2. Run a second server in the public internet, for example hosted in a cloud service. After students have fixed the client, it should run without recompilation against the second server, too. For me, this would link the exercise to another topic I'm covering in my lectures.
  3. Provide a server implementation that students can run on their workstation. Let students test every step against the local server as well as against the server on the instructor's machine. This will tempt students to look at the local server implementation and/or to import that into their IDE, see issue #25. An advantage is that students would have access to the log file of their local server, and that they can select a different log level there.
rolandweber commented 7 years ago

As a stop-gap measure, I'm improving the inline comments to explicitly mention that host and port should be taken from the command line. I wonder how many are going to ignore that comment anyway ;-)

rolandweber commented 6 years ago

There's no point in pursuing this further. If students choose to ignore instructions, I can't help it.