Advanced Java Using Eclipse

This course teaches how to develop advanced Java applications using Eclipse. The advanced features of Java that developers may be using in many different types of programs are covered.

Topics

  • JavaBeans

  • JUnit

  • JDBC

  • JPA (Java Persistence)

  • Java Logging API

  • Internationalization

  • The Reflection API

  • Architecture

  • Threads

  • Networking

  • Distributed Objects

  • Parsing XML with SAX

  • Parsing XML with DOM

  • JAXB (Java-XML Binding)

  • JNI

  • Security

  • Summary of Recent Java Changes


Practical Work
The labs cover many advanced topics that students will encounter when programming Java applications. Together these labs give students practical hands-on experience in creating and deploying advanced Java technologies using Eclipse.

After completing this course, the student should be able to:

  • Test Java code using JUnit

  • Understand how to connect to databases and work with data

  • Use the logging capabilities built into the Java language

  • Use the support for multiple languages provided by Java

  • Use the reflection API to programmatically obtain details on Java classes

  • Provide better architecture for Java programs

  • Work with multi-threaded Java applications

  • Use networking and distributed technologies of Java

  • Work with XML from Java code

  • Use Java capabilities to intergrate with non-Java code

  • Use the security APIs provided with the Java language

Course Outline

CHAPTER 1 - COLLECTIONS AND GENERICS

What are Collections?
Arrays vs. Collections
Main Collections Interfaces
java.util.Collection
Main Collection Methods
Sets
java.util.List
java.util.Queue
Iteration on a Collection
Iterator vs. For-Each Loop
Maps
java.util.Map
Other Maps
Collections Implementations
Abstract Implementations
Choosing a Collection Type
Generics
Generics and Collections
Generic Collection Example
Collections and Primitive Types
Summary

CHAPTER 2 - JAVABEANS

Overview
Structure
Life Cycle
Properties
Example
Making a Bean

CHAPTER 3 - JDBC

Overview
Types of Drivers
Making a Connection
Statements
Execute, Update and ResultSets
SQLException
Prepared Statements
Stored Procedures
Transactions
Connection Pooling

CHAPTER 4 - ENTITIES AND JAVA PERSISTENCE API

Data Persistence
Java Persistence API
Entities
Session Beans Vs Entities
Entities
Persisting and Retrieving Data
Accessing Entities
EntityManager & Persistence Unit
Persistence Context
Entities - Example
persistence.xml – Hibernate Provider
persistence.xml – Open JPA Provider
persistence.xml - Toplink
Entity Instance Lifecycle
Creating EntityManager in Session EJB
Creating EntityManager in a Plain Java Class
Working With the EntityManager Interface
Transaction Basics
Summary

CHAPTER 5 - INTERNATIONALIZATION

Internationalization
Adoption Stages
Internationalization
Locale
Dates
User Interface design
Resource Bundles
Other Local Customs
How Java Represents Characters
Text Files
Text files
Summary

CHAPTER 6 - THE REFLECTION API

Overview
Dynamic Facilities In Java
What this Dynamic Aspect Implies
Considerations
The Class class
Examining Classes
The Example From Last Time
An Example
Reflection Allows
Reflection Also Allows
When Not to Use Reflection
Examining Classes
Manipulating Objects
Creating Objects
Getting Field Values
Setting Field Values
An example
Arrays
Summary

CHAPTER 7 - ARCHITECTURE

Tiered Architectures
Presentation Layer
Middle Tier
Model View Controller
Extensible Markup Language
XML

CHAPTER 8 - THREADS

Overview of Threads
Threads in Java Programming
Write a Runnable Class
Create Threads
Another Way of Creating Threads
Two ways of creating threads
States in a Thread’s Lifetime
JVM Scheduler
Control and Schedule Thread
Executor Interface
Callable<V> Interface
ExecutorService Interface
Future<T> Object
Coordinating the Concurrency of Multiple threads
Synchronization
How Does the Object Lock Flag Work
Using the synchronized keyword
The implication of synchronization
Example of Synchronization - Producer/Consumer
Example of Synchronization – MyStack
Example of Synchronization – Producer
Example of Synchronization – Consumer
Example of Synchronization – SyncTest
But…
Coordinating Thread Cooperation
wait() and notify()
Example of Coordination Producer/Consumer
Example of Coordination – MyStack
Results
Deadlock

CHAPTER 9 - NETWORKING

Overview
URL Connections
Browser Example
InetAddress
Socket Classes
Simple Clients and Servers
Simple Clients and Servers (cont.)
Multithreaded Servers
UDP Sockets

CHAPTER 10 - PARSING XML WITH SAX

Obtaining a Parser
SAX
How it Works
Core SAX2 Handler Classes
SAX2 DefaultHandler
SAX Events
Ignorable Whitespace
Parsing a Document
Using SAXParserFactory
Parse XML with SAX – Details
Define an Event Handler
Create a SAXParserFactory instance
Define an Event Handler – startElement()
Define an Event Handler – Element Attributes
Define an Event Handler – Get Number of Attributes
Define an Event Handler – Get Name of Attributes
Define an Event Handler – Get Attribute Values
Define an Event Handler – An Example
Define an Event Handler – characters()
Using characters()
Define an Event Handler – Error Handling
Define an Event Handler – ErrorHandler interface
Parse XML Document
Simple SAX Parser
EntityResolver
Locator
Document Locator

CHAPTER 11 - PARSING XML WITH DOM

DOM
Limitations of SAX
XML as an Object Model
Nodes
The Basic Node Types
Less Common Node Types
Node Interface
Document Interface
NodeList Interface
Element Interface
Attr Interface
Text Interface
DOM Parsing
Parse XML with DOM – Steps
Prepare DOM Parser Object
Parse XML Document
Parse Exceptions
Example – SimpleDOMParser
Writing DOM

CHAPTER 12 - THE JAVA ARCHITECTURE FOR XML BINDING (JAXB)

Introduction to JAXB
Overview of Data Binding
JAXB Architecture
Binding Example
Binding Framework Example
Java and XML Mapping Overview
Namespace and Package Name Mapping
Simple Type Mapping
Complex Type Mapping
Customizing Complex Type Mapping
Property Accessor Customization
Property Mapping Customization
XML Element Mapping
Mapping Java Enums
Mapping Collections
Generating Java Class and Schema
Marshalling and Unmarshalling
Summary

CHAPTER 13 - JAVA LOGGING API

Java Logging API
Control Flow of Logging
Logging Levels
Logging Handlers
Loggers
Logging Example
Logging Formatters & Log Manager
Logging Configuration File
Example Logging Configuration File
Logging Filters

CHAPTER 14 - DISTRIBUTED OBJECTS

Serialization
Externalizable
Remote Method Invocation
Steps to implement RMI
RMI – Remote Object Registry
RMI – Dynamic class loading
RMI and Applets
Summary

CHAPTER 15 - SECURITY

Attacks and Dangers
Overview of JDK Security Features
Overview of JDK Security Features – cont’
Basic Concepts of Computer Security
Encryption
Cryptography Algorithm
Message Digest
Symmetric Ciphers
Asymmetric Ciphers
Digital Signature
Authentication
Certificate Manipulation
Java Cryptography Architecture (JCA)
Java Cryptography Extension
Using the MessageDigest Class
Example of Using the MessageDigest Class
Example of Using MessageDigest Class – cont’
Using the Signature Class
Java Security Architecture
JDK 1.0 Security Model –Sandbox
JDK 1.1 Security Model – Trusted Signed Code
JDK 1.2 Security Model – Security Policy
JDK 1.4 Security Enhancement
Protection Domains and Security Policies
ProtectionDomain Class
Permission Classes
Using Permission Classes
Policy Class
Policy Configuration File
AccessController Class
SecurityManager Class
Using the SecurityManager Class
Dynamic Class Loader
Loader Classes
Example of Security Check in a Class Loader
Java Security Tools
Using Java Security Tools – Code Signing

CHAPTER 16 - JNI

Overview
JNI Architecture
Calling C Functions
The Header File
Passing Simple Parameters
Mapping Java Types
Calling Java Methods
The Invocation API
Exception Handling
Native Exception to Java
Java Exception In Native Code
Code Sample

CHAPTER 17 - JUNIT

What is JUnit?
Why JUnit?
The xUnit Philosophy
Test-Driven Design
A JUnit Test
Running the Tests
Swing-based Test Runner
Text-based Test Runner
JUnit Basics
assertTrue
assertEquals
assertSame
assertNull
The Failure Message
The Test Class
The Test Method
The Test Suite
JUnit with Annotations
JUnit 4 Test Suite
JUnit Design
Testing Strategies
Specific Techniques
Testing Simple Java classes
Testing with Databases
Testing Web Applications
Testing Java EE Web Applications
JUnit with Ant
Summary
JUnit with Eclipse
Create a Test Case
Test Case "Stubs"
Running Tests
Eclipse Test Runner Icons
Rerun an Individual Test
Failure Trace
Debug with JUnit
Test Suite Wizard

CHAPTER 18 - SUMMARY OF RECENT JAVA CHANGES

Java 5 – Major New Features
Java 5 - Type Safe Enums
Java 5 – Generics
Java 5 - Generics and Collections
Java 5 - Generic Collection Example
Java 5 – Autoboxing/Unboxing
Java 5 - Enhanced for loop
Java 5 - Variable Arguments
Java 5 - Variable Arguments Example
Java 5 - Static import
Java 5 – Annotations
Java 5 - Library Additions
Java 6 – Major New Features
Java 6 - Web Services
Java 6 - XML
Java 6 - Database
Java 7 – Major New Features
Java 7 – Generic Diamond Operator
Java 7 – Catching Multiple Exceptions
Java 7 – Rethrowing Exceptions
Java 7 – try-with-resources Statement
Java 7 – Suppressed Exceptions in try-with-resources
Java 7 – Strings in switch Statement
Java 7 – Changes in Numeric Literals
Java 7 – Fork & Join Parallel Processing
Java 7 – NIO.2 File Systems
Summary

APPENDIX A - MOCKITO

The Problem
Old Solutions
Bad Solutions?
What's the other choice?
Choices
Mocking stubs
Mocking Mocks
Mostly done.
Other features
Other features II
Other features III
Spy
Annotations
Summary

Audience



This course is intended for programmers who are familiar with Java and want to learn about the advanced features of Java.

Prerequisites

A good understanding of object-oriented programming using Java.


 

Available Course Dates

11/20/2017 10:00 am - 11/24/2017 6:00 pm
Click here to sign up for this class