Intermediate Java

Course name: Intermediate Java

Dates: 25th to 28th September 2017

Time: 9:30a.m – 5:00p.m.

Duration: 4 days

Training Provider: Instil

Venue: Fitzgerald Vienna Woods Hotel, Glanmire, Cork

Member-subsidised fee: 900 Euro

Non-member fee: 1500 Euro

 

To register your interest or to book a place please email Annette Coburn on skillnet@itcork.ie 

 

Description

This is a fast paced course designed to introduce all the features of Java 8. It is aimed primarily at graduates, who have had exposure to the syntax and core concepts of the language and now wish to deepen their knowledge before working on production code.
By the end of the course delegates will be able to write both Object Oriented and Functional code fluently in Java. They will understand the generic collections and be able to create their own generic types. In addition they will have written concurrent programs using thread pools, futures, the fork/join framework and parallel streams.

There will be a strong emphasis on Agile Development during the delivery. Delegates will develop programs using both TDD and BDD via popular tools such as JUnit, Mockito and Cucumber. They will also be encouraged to use the refactoring support within the IDE to continuously improve the quality of their code.

The course will be delivered using the IntelliJ IDE (Community Edition) from JetBrains. Other popular IDE’s, such as Eclipse, will also be shown. Both the Maven and Gradle build tools will be introduced. There will also be an optional module covering UI development via the Google Web Toolkit (GWT).

Prerequisites

Delegates should be familiar with the basic syntax of the ‘C’ family of languages and have some experience of Object Oriented Development. Prior exposure to Functional Programming is very helpful but not essential.

 

Modules

 

Core Concepts

  • Origins and goals of the Java language
  • Bytecode and the Java Virtual Machine
  • The classpath environment variable
  • Packages and dynamic class loading
  • Garbage collection in Java

Basic Java Programming

  • Primitive types and literal values
  • Java 7 syntax for binary and numeric literals
  • The difference between reference and value types
  • Converting between strings and numerical types
  • String parsing with the Scanner class
  • Pretty-printing with the Formatter class
  • Performing iteration and selection in Java
  • Java 7 support for strings in switch statements
  • Equality of primitive and reference types
  • Creating and manipulating arrays
  • The costs of String concatenation

Object Oriented Development Part 1

  • Creating basic Java classes
  • Choosing accessibility levels
  • Overloading and overriding methods
  • Overriding the toString method
  • Comparing references using the instance of operator
  • Comparing references using java.lang.Class objects
  • Inheriting from a base class
  • Creating abstract and final classes

Object Oriented Development Part 2

  • Writing appropriate class constructors
  • Private constructors and singletons
  • Static and instance initialization blocks
  • Top down class and object initialization
  • Declaring and using interfaces to represent contracts
  • Default implementations for interface methods
  • Using inner and anonymous classes
  • Implementing equal and hashcode
  • Investigating types using the reflection library

Introducing Refactoring

  • Technical debt and the problem of ‘code rot’
  • Why you need to refactor your code to keep it alive
  • Refactoring as the ‘second hat’ you wear while coding
  • Common ‘smells’ in code and how to remove them over time
  • Using refactoring to incrementally introduce Design Patterns

Test Driven Development and Mocking

  • Why refactoring requires a comprehensive test suite
  • Introducing the Test Driven Development coding cycle
  • Problems experienced during TDD and their solutions
  • Myths about TDD and common traps to be avoided
  • How encapsulated dependencies prevent testing
  • Using dependency injection to enable testing
  • The different types of Test Double (aka. mocks)
  • Creating and injecting Test Doubles via ‘Mockito’

Understanding Behaviour Driven Development

  • Involving the whole team in Test Driven Development
  • Moving from tests in code to specifications in a DSL
  • The Gherkin syntax for describing features and scenarios
  • Using Cucumber to build a DSL for testers and analysts
  • Combining TDD and BDD without overlap and duplication

Enumerations in Java

  • Why Java historically lacked enum support
  • The typesafe enumeration design pattern
  • How Java 5 baked the pattern into the language
  • The link between enums and classes
  • The java.lang.Enum base class
  • Extending enums with new members
  • Static methods added to enum types
  • New collections which support enums

Annotations and Meta-Programming

  • Adding metadata to Java code
  • The advantages of annotations
  • Annotations verses configuration files
  • Declaring Java 5 annotation types
  • Understanding meta-annotations
  • Adding methods to annotation types
  • Defining default values for methods
  • Discovering annotations with reflection
  • Writing annotation processors in Java 6
  • Enhancements to annotations in Java 8

Exception Handling in Java

  • Introducing errors, runtime exceptions and checked exceptions
  • Exceptions in constructors and finalizers
  • Implementing an effective exception handling strategy
  • Using finally blocks properly to perform ‘clean-up’ tasks
  • Java 7 improvements to the try…catch syntax
  • The try-with-resources syntax introduced in Java 7

Generics in Java Part 1

  • The evolution of Generics in Java
  • Generics as a compile time construct
  • Generics verses templates in C++
  • Comparing Generics and inheritance
  • Working with generic collection classes
  • Introducing the java.lang.Class type
  • Support for Generics in the Reflection API

 

Generics in Java Part 2

  • Declaring generic classes and methods
  • Type inference in Java 7 when creating generic objects
  • Using the wildcard type in utility methods
  • Defining constraints with bounded wildcards
  • Adding generics to existing Java code

Functional Programming with Method References and Lambdas

  • Overview of the key concepts of Functional Programming
  • The concept of ‘method references’ in the language and JVM
  • Creating references to methods and constructors
  • Understanding when and why to use lambda expressions
  • The various syntax options when declaring lambdas
  • Making use of the @FunctionalInterface annotation
  • Lexical scoping and ‘effectively final’ variables
  • Type inference of parameters in lambdas
  • Best practises when declaring and using lambdas

Functional Programming With Collections and Streams

  • Introducing the java.util.stream.Stream interface
  • Creating streams of objects from collections and via of
  • Using parallel and sequential to switch processing model
  • Performing filtering and mapping on the contents of streams
  • Using reduce to compute a final value from a stream
  • Understanding the purpose and value of flatMap
  • Performing bulk operations on the elements of collections
  • The Optional Monad and Monadic Composition

The Date and Time API

  • How JSR310 evolved from the Joda Time library
  • Working with instants, clocks and time zones
  • Performing calculations with dates and times
  • Using adjusters to make common changes to dates
  • Parsing and formatting dates and times
  • Combining the API with legacy code

 

Java Concurrency

  • The threading model in Java prior to version 5
  • Creating threads using Executor objects
  • Storing return values in Future objects
  • Designing parallel algorithms using the ‘fork-join’ framework
  • Lock objects as an alternative to the synchonized keyword
  • Making full use of the ‘thread-friendly’ collection classes
  • Scalable thread-safe counters in java.util.concurrent
  • Parallel array sorting using new methods in java.util.Arrays

 

The Google Web Toolkit (Optional)

  • How the GWT allows Java coders to create Web Apps
  • Configuring a GWT based project within IntelliJ
  • Building basic UI’s and adding event handling
  • Options for laying out widgets and adding styles
  • Creating custom widgets and using Dependency Injection
  • Designing and testing complex interfaces with GWT
  • Integrating your own JavaScript functionality

 

To register your interest or to book a place please email Annette Coburn on skillnet@itcork.ie