
Last updated: 2024-12-18
General information and introduction
This module provides an in-depth exploration of advanced Java programming concepts before ending with a brief introduction to functional programming using Haskell. The module consists of 9 units, covering a wide range of topics. The Java parts of the module overlap to a large extent with industry-standard professional Java certifications.
Aims
The aim of this module is to introduce the students to more advanced programming constructs and techniques.
Learning Outcomes
After completing this module, students will be expected to be able to:
- Demonstrate an understanding of the programming constructs and techniques introduced to this module;
- Use these constructs and techniques in the design and implementation of programs, and
- Critically reflect on program designs.
Syllabus outline
- Unit 1: Java Review, Functional Interfaces, Unit tests
- Java Review
- The JVM and the JVM memory model
- Inheritance
- Encapsulation
- Abstraction
- Polymorphism
- Working with packages
- Functional Interfaces
- Definition, and Functional Interfaces in the Java standard library
- Anonymous Classes
- Lambda Expressions
- Method references
- Labs:
- Compiling code from the (linux) terminal
- Practice working with functional interfaces
- Unit tests using junit
- Java Review
- Unit 2: Threads and Synchronisation
- Concurrency: Threads vs Processes vs Coroutines.
- Overview of Java Threads
- Synchronisation techniques, and why we need them.
- Liveness problems: deadlocks, livelocks, starvation.
- Coarse-grained vs Fine-graned concurrency
- Labs:
- Practice and understand Thread basics.
- Practice and understand race conditions
- Practice and understand Cyclic Barriers
- Using threads to achieve Parallelisation for speeding-up computation.
- Unit 3: Cloning - IO - Serialisation - JSON
- Types, Values, and Variables
- Statically vs Dynamically typed, and Stongly vs Weakly typed languages
- Primitive vs Reference types, and their memory storage semantics.
- Copying objects: Deep vs Shallow copying
- Input / Output (IO) streams
- Serialisation and deserialisation
- Using JSON
- Labs:
- Practice and understand cloning, and the Cloneable interface
- Practice working with IO streams.
- Practice Serialisation / Deserialisation
- Practice working with JSON through the gson library
- Types, Values, and Variables
- Unit 4: Sockets and Client-Server architectures
- Introduction to internet sockets
- Example of Client-Server architecture (Bank)
- Labs:
- Practice developing and working with client-server applications
- Debugging client-server programs using netcat, telnet, jdb.
- Unit 5: Web Services
- The HTTP protocol
- HTTP Requests
- HTTP Responses
- Web applications vs Web services
- Representational State Transfer (REST) principles
- JAX-RS / Jersey for designing RESTful interfaces in Java
- Labs:
- Practice working with Jersey and Tomcat
- The HTTP protocol
- Unit 6: Collections and Generics
- Introduction to Generics
- Raw types and motivation
- Generic Classes, Type Variables and Type Parameters
- Diamond operator vs local variable type inference (the 'var' keyword)
- Generic methods
- Bounded (wildcard) types
- Type Erasure; definition and consequences
- Collections in the Java standard library
- Varargs
- Labs:
- Practice working with Varargs
- Importance of SafeVarargs when using Varargs with Generic types.
- Working with Generics and Collections
- The Producer-Consumer pattern
- Practice working with Varargs
- Introduction to Generics
- Unit 7: Optionals and Streams
- The Optional class
- Streams
- Straightforward parallelisation using Streams
- Labs:
- Practice working with Optional
- Practice working with Streams
- Practice parallelisation using Streams
- Unit 8: Modules, Reflection, Annotations, Optimisation and Design Patterns
- Java modules
- Definition, and introduction to working with modules
- Service interfaces, implementations, and clients using modules
- Other notable changes since java 8
- Switch expressions, textblocks, records, pattern matching, template processors
- Reflection
- The Class object
- The Reflection API
- Annotations
- Optimisation techniques
- Memoization, caching, tabulation, pagination, loop fusion, backgracking
- Tail-call recursion (naive vs Stream based).
- Parallelisation and Amdahl's Law
- Design Patterns
- SOLID Principles
- Decorator and Adapter patterns
- The Singleton pattern
- Factory and Builder patterns
- Labs:
- Practice and understand working with modules
- Practice working with Reflection and Annotations
- Tailcall-Loop equivalence theorem, and implementing tail-recursive algorithms
- Practice and understand the Adapter and Decorator patterns
- Java modules
- Unit 9: Introduction to functional programming with Haskell
- Introduction to Haskell
- Functions, currying, and partial application
- Algebraic Data Types and TypeClasses
- Labs:
- Practice working on ghc and ghci.
- Practice working with Haskell modules
- Tailcall-Loop equivalence theorem, implementing tail-recursive algorithms in Haskell
- List Comprehensions in Haskell
- Working with Data Types and TypeClasses, including Functors, Applicatives, Monads, and IO.
- Module Supervisor: Tasos Papastylianou
Category: Undergraduate