Link to the DIT Home Page

Dublin Institute of Technology, School of Computing
Ciarán O'Leary

  Home -> Teaching -> DT249-4 Distributed Systems -> Notes -> Week 01
  DT249-4 Distributed Systems

Week 01


Learning Outcomes:

Upon completion of this class, you should be able to:

  1. Demonstrate an awareness of the characteristics of concurrency, independent failure of components and lack of a global clock, which necessarily arise in a distributed system consisting of components that coordinate their actions only by passing messages.
  2. Place distributed systems in a realistic context through examples.
  3. Justify the benefits of resource sharing and use the Web as an example.
  4. Demonstrate a clear understanding of the challenges related to heterogeneity, openness, security, scalability, failure handling, concurrency and transparency as they apply to distributed systems.

Tasks

1.

You may wish to set Java up at home or in work. If so, you can find instructions here.

 

2.

Hello World Example

Download the file DS_01_01.java and save it into your local directory.

Compile the program as follows:

:/> javac -classpath . DS_01_01.java

Run a dir command. You can see that the compiled version of the program is in a single .class file.

Run the program by executing the following command:

:/> java -classpath . DS_01_01

This command invokes the Java interpreter (a part of Java's Runtime Environment) which will convert the Java bytecode into the machine code for the platform upon which the program is running (Windows / Unix etc.)

 

3.

Reading User Input

Download, compile and run DS_01_02.java. This program reads input from the user and prints the inputted text string to the terminal.

 

4.

Command Line Arguments

DS_01_03.java takes input from the user via the command line i.e. additional information provided by the user when executing the program. This program will take in the user name and two integers, as follows:

:/> java DS_01_03 Tom 10 29

It then multiplies the the numbers and displays the output.

 

5. Write a simple Java program that takes a single word as a command line argument and then continuously prompts the user to enter words until they enter the same word as was passed as a command line argument.

Note that to check the equality of two strings, you use the .equals method e.g.

String x = "Hello";
String y = "World";
boolean b = x.equals(y);


Further Reading

Chapter 1 of Coulouris, Dollimore and Kindberg book

 

Hit Counter  [Home][School of Computing][Dublin Institute of Technology]