Duration: 5days | NTJVA201
Description
nTier’s intermediate Java training course teaches programming focuses on core Object Oriented Principles
and concepts, Unit Testing and Test Driven Development, key Java functionalities. It is intended for students
with some previous Java experience or training and who already know the fundamentals of the Java
architecture and basic procedural programming. This course provides in-depth coverage of object-oriented
concepts and how to apply them to Java software design and development. This includes the introduction of
some core design patterns and the advantages that they bring to an extensible design.
Students must be able to write, compile, test and debug simple Java programs using structured programming
techniques, strong data types and flow- control constructs such as conditionals and loops. At least six months
of Java experience is recommended.
Objectives
● Chiefly, learn to program effectively in the Java language
● Understand Java as a purely object-oriented language, and implement software as systems of classes
● Implement and use inheritance and polymorphism, including interfaces and abstract classes
● Utilize Functional Interfaces i.e. Lambdas, Generics, Optional and LocalDateTime API
● Understand the structure of streams in Java including predicates, mapping, reducing and finding
● Use JUnit capabilities
● Use Test Driven development (TDD) to evolve the design, utilize common refactoring techniques to
overcome code smells
● Learn how to leverage Files, and how to use streams to manage file I/O
● Learn how to use Java Serialization to internalize and externalize potentially complex graphs of
objects
Prerequisites
Students must be able to write, compile, test and debug simple Java programs using structured programming
techniques, strong data types and flow-control constructs such as conditionals and loops. At least six months
of Java experience is recommended.
Outline
● Object-Oriented Software
o Complex Systems
o Abstraction
o Classes and Objects
o Responsibilities and Collaborators
o Lightweight Design
o Relationships
o Visibility
● Inheritance and Polymorphism in Java
o Extending Classes
o Using Derived Classes
o Type Identification
o Compile-Time and Run-Time Type
o Polymorphism
o Overriding Methods
o Superclass Reference
o Lab – Build by extension rather than modification
● Interfaces and Abstract Classes
o Separating Interface and Implementation
o Designing Interfaces and Interface Realization
o Implementing and Extending Interfaces
o Default Methods, Static Methods and Functional Interfaces (Lambda)
o Abstract Classes
o Lab – Advanced Interfaces
● Generics
o Raw Types
o Generic Methods and Bounded Type Parameters
o Upper and Lower Bounded WildCards
o Type Erasure
o Lab – Using Generics
● Unit Testing
o JUnit
o JUnit Life Cycle, @BeforeAll, @BeforeEach, @Test, @AfterEach, @AfterAll,
o Using assertThat and Hamcrest Matchers
o Parameterized Tests
o Testing Exceptions
o Lab – Unit Testing
● Test Driven Development (TDD)
o Defining your API
o Writing tests First, Design Test, Code, refactor cycles
o Refactoring techniques and code Smells
o Test Antipatterns
o Lab TDD
● Understanding Patterns
o Refactoring to Patterns
o Factories and Builders
o Lab – Creational pattern
o Strategy
o Adapter
o Template Method
o Lab – Structural and behavior patterns
● Lambdas
o Functional Interfaces
o Java.util.function package – Consumer, BiConsumer, Function, BiFunction and Predicate
o Generics and Type coercion in Lambdas
o Creating your own Functional interfaces
o Method References
o Lab – using Lambdas
● Streams
o Streams vs Collections
o Intermediate and Terminal Operations
o Filtering with Predicates
o Mapping and transforming, flatMaps
o Reducing, numeric Streams
o Lab – simple streams
o Collectors
o Grouping
o Finding elements in streams
o Parallel Streams
o Fork and Join framework
o Lab – Parallel streams, executor
● Optional
o Representing optional values instead of using null references
o Optional.of(), Optional.ofNullable()
o Using get(), orElse(), isPresent()
o Lab – using Optional
● Date and Time API
o LocalDateTime
o Formatting Dates
o Parsing date time objects
o Lab – LocalDateTime
● Working with Files
o Delegation-Based Stream Model
o InputStream and OutputStream
o Media-Based Streams
o Filtering Streams
o Readers and Writers
o File Class
o Modeling Files and Directories
o File Streams
o Random-Access Files
o Lab – Readers and writers
● Java Serialization
o The Challenge of Object Serialization
o Serialization API
o Serializable Interface
o ObjectInputStream and ObjectOutputStream
o The Serialization Engine
o Transient Fields
o readObject and writeObject
o Externalizable Interface
o JAXB marshalling and unmarshalling
o Lab – Serialization