diff --git a/slides/images/how-java-program-runs.webp b/slides/images/how-java-program-runs.webp deleted file mode 100644 index db2682f15439c2d060148b26c4894be4c799f5b6..0000000000000000000000000000000000000000 Binary files a/slides/images/how-java-program-runs.webp and /dev/null differ diff --git a/slides/images/http-header.png b/slides/images/http-header.png new file mode 100644 index 0000000000000000000000000000000000000000..993d1ba5d0db9fa1b3370fe33c4b09510419b933 Binary files /dev/null and b/slides/images/http-header.png differ diff --git a/slides/images/https-detailed.webp b/slides/images/https-detailed.webp new file mode 100644 index 0000000000000000000000000000000000000000..92cbce8fa5961bc8ef07099f98bdc1d783002b64 Binary files /dev/null and b/slides/images/https-detailed.webp differ diff --git a/slides/images/jdk-jre-jvm.webp b/slides/images/jdk-jre-jvm.webp deleted file mode 100644 index bd1b88cddc1b432401c8cedd39be1e2e6e9e7fc0..0000000000000000000000000000000000000000 Binary files a/slides/images/jdk-jre-jvm.webp and /dev/null differ diff --git a/slides/images/jdk.webp b/slides/images/jdk.webp deleted file mode 100644 index 2412662eb47266a32aa153ec324fe1968094b7b2..0000000000000000000000000000000000000000 Binary files a/slides/images/jdk.webp and /dev/null differ diff --git a/slides/images/jre.webp b/slides/images/jre.webp deleted file mode 100644 index 3dcc762ba3c183c93cf05a15ec346229e9b6e856..0000000000000000000000000000000000000000 Binary files a/slides/images/jre.webp and /dev/null differ diff --git a/slides/pages/qa.md b/slides/pages/qa.md index c79648f0704529925983bc64525604f7d78a8d2b..61e7178021255f9b3c4f6c4c3f268b7ee146cd14 100644 --- a/slides/pages/qa.md +++ b/slides/pages/qa.md @@ -6,7 +6,6 @@ title: Q&A Any questions about: -- Seventh Assignment Sheet - Eighth Assignment Sheet - Topics from the lectures - Organisation diff --git a/slides/pages/recap.md b/slides/pages/recap.md index 0f3793ac53ea6d27ed900bd35b00173fb2676983..7d6d5031db29d57ec6627d9731462ca135e3e52b 100644 --- a/slides/pages/recap.md +++ b/slides/pages/recap.md @@ -1,136 +1,107 @@ --- title: Agenda -layout: center --- -# Agenda +# Recaps & Discussion -- Presentation -- Java - ---- -title: Java I ---- - -# Java JDK, JRE and JVM - -Know the difference between JDK, JRE and JVM. - -### What is JVM? +Discuss the following topics and explain those concepts in your own words to your teammates: +<br/> -JVM (Java Virtual Machine) is an abstract machine that enables your computer to run a Java program. - -<div class="container flex justify-center mt-20"> - <img src="/images/how-java-program-runs.webp" class="block w-lg"/> -</div> +- What is IPC? +- What is RPC? +- What are the differences between RPC and IPC? +- What roles do protocols play in IPC/RPC? +- What are common protocols used in IPC/RPC? +- What are the external data representations used in IPC/RPC? +- What are marshalling and unmarshalling? --- -title: Java II +title: HTTP(s) I +layout: two-cols --- -### What is JDK? +# HTTP -JDK (Java Development Kit) is a software development kit required to develop applications in Java, including JRE, the compiler, interpreter, etc. +**HTTP** stands for **Hypertext Transfer Protocol**. +It is the protocol that enables communication between different systems, transferring information and data over a network. -<div class="container flex justify-center mt-20"> - <img src="/images/jdk.webp" class="block w-sm"/> -</div> +It is a: ---- -title: Java III ---- +- Text-based protocol +- Stateless protocol +- Application layer protocol -### What is JRE? +It is used for: -JRE (Java Runtime Environment) is a software package that provides Java class libraries, Java Virtual Machine (JVM), and other components that are required to run Java applications. +- Client-server model +- Request-response model +- Distributed, collaborative, hypermedia information system -<div class="container flex justify-center mt-20"> - <img src="/images/jre.webp" class="block w-sm"/> -</div> +::right:: ---- -title: Java IV ---- - -### Relationship between JVM, JRE, and JDK - - -<div class="container flex justify-center mt-20"> - <img src="/images/jdk-jre-jvm.webp" class="block w-sm"/> +<div class="container flex justify-center"> + <img src="/images/http-header.png" class="block w-md"/> </div> + --- -title: Java Dev Environment Setup -layout: center +title: HTTP(s) II --- -# Java Dev Environment Setup +### A typical HTTP request <br/> -- Using an IDE is recommended: [IntelliJ IDEA](https://www.jetbrains.com/idea/download/), [Eclipse](https://www.eclipse.org/downloads/) -- Install JDK: [Oracle JDK 17](https://docs.oracle.com/en/java/javase/17/install/overview-jdk-installation.html#GUID-8677A77F-231A-40F7-98B9-1FD0B48C346A) (same version on Andorra) -- Use [Gradle](https://gradle.org/) for building and running your project, or use the IDE's built-in tools -- Use [Package Search](https://package-search.jetbrains.com/) to find your java libraries - - ---- -title: Gradle I ---- - -# Gradle - -- Gradle is an open-source build automation tool focused on flexibility and performance. -- Gradle build scripts are written using a **Groovy** or **Kotlin** DSL. -- Check out the [Installation Guide](https://docs.gradle.org/current/userguide/installation.html) -- `build.gradle/build.gradle.kts` is the main configuration file for a Gradle project -- `gradlew` is the Gradle wrapper script, which is used to execute Gradle tasks for Linux or MacOS -- `gradlew.bat` is the Gradle wrapper script for Windows +```http +GET / HTTP/1.1 +Host: www.example.com +User-Agent: Mozilla/5.0 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8 +Accept-Language: en-GB,en;q=0.5 +Accept-Encoding: gzip, deflate, br +Connection: keep-alive +``` --- -title: Gradle II +title: HTTP(s) III --- -## Write a Task in Gradle Build Script - -Write a task in gradle build script to run java program. - -```kotlin -tasks.register<JavaExec>("<task-name>") { - // if your program needs input from stdin - standardInput = System.`in` +### A typical HTTP response - // Set the main class to be executed - mainClass.set("<main-class>") - - // Set classpath dependencies if needed - classpath = sourceSets.main.get().runtimeClasspath - - // Set JVM arguments if needed - // jvmArgs = listOf("-Xmx512m") +<br/> - // Set program arguments if needed - // args = listOf("arg1", "arg2") -} +```http +HTTP/1.1 200 OK +Date: Mon, 23 May 2005 22:38:34 GMT +Content-Type: text/html; charset=UTF-8 +Content-Length: 155 +Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT +Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux) +ETag: "3f80f-1b6-3e1cb03b" +Accept-Ranges: bytes +Connection: close + +<html> + <head> + <title>An Example Page</title> + </head> + <body> + <p>Hello World, this is a very simple HTML document.</p> + </body> +</html> ``` -See live demo in the tutorial. - --- -title: Gradle III +title: HTTP(s) IV --- -## Exercises I +### HTTPS -<br/> +**Hypertext Transfer Protocol Secure (HTTPS)** is an extension of the HTTP protocol. -- Create a new Gradle project -- Adapt the java files in `exercises/client-server` to the project -- Write a task in the Gradle build script to run the server +**HTTP = HTTP + TLS/SSL** -## Exercises II - -<br/> - -- Using threads to handle multiple clients in the server +<div class="container flex justify-center"> + <img src="/images/https-detailed.webp" class="block w-md"/> +</div>