877-277-2477
info@capstonecourseware.com
106. Advanced Java Programming
Version 6.0

Book cover

This course provides advanced training in developing software using the Java Platform, Standard Edition, or Java SE. It is intended for students with solid experience in structured and object-oriented Java programming, including use of the Collections API and exception handling.

The course covers several general-purpose topics: using and building generic types, writing multi-threaded applications, the Reflection API and annotations, and network programming using sockets. It combines nicely with various other courses in the Java curriculum, each of which is also "advanced Java" of some sort: JDBC, secure coding, Swing GUI programming, design patterns, and so on.

Prerequisites

  • Solid Java programming experience is essential -- especially object-oriented use of the language. Language features and techniques that are integral to some lab exercises include interfaces and abstract classes, threading, generics and collections, and recursive methods. Course 103, "Java Programming," is excellent preparation.

Learning Objectives

  • Make effective use of Java generic types.
  • Write multi-threaded Java applications.
  • Use the Reflection API for highly generic tasks, discovery, or code-generation.
  • Use standard annotations and develop custom annotations to express meta-data in Java source files.
  • Communicate between processes using network sockets.

Timeline: 2 days.

IDE Support: Eclipse Europa

  • In addition to the primary lab files, an optional overlay is available that adds support for Eclipse Europa. Students can code and build all exercises from within the IDE. Most exercises can be tested from within the IDE as well, though some must be tested from the command line. See also our orientation to Using Capstone's Eclipse Overlays, and please be advised that this is an optional feature; it is not a separate version of the course, and the course itself does not contain explicit Eclipse-specific lab instructions.

Chapter 1. Generics

  • Using Generics
  • Type Erasure
  • Type Boundaries
  • Wildcards
  • Generic Methods
  • Strengths and Weaknesses of Generics
  • Legacy Code and Generics

Chapter 2. Threads

  • Java Thread Model
  • Creating and Running Threads
  • Manipulating Thread State
  • Thread Synchronization
  • Volatile Fields vs. Synchronized Methods
  • wait and notify
  • join and sleep
  • The Concurrency API
  • Atomic Operations

Chapter 3. Reflection

  • Uses for Meta-Data
  • The Reflection API
  • The Class<T> Class
  • The java.lang.reflect Package
  • Reading Type Information
  • Navigating Inheritance Trees
  • Dynamic Instantiation
  • Dynamic Invocation
  • Reflecting on Generics

Chapter 4. Annotations

  • Aspect-Oriented Programming and Java
  • The Annotations Model
  • Annotation Types and Annotations
  • Built-In Annotations
  • Annotations vs. Descriptors (XML)

Chapter 5. Sockets

  • The OSI Reference Model
  • Network Protocols
  • The Socket Class
  • The ServerSocket Class
  • Connecting Through URL Objects
  • HTTP and Other TCP Servers
  • Datagram Clients and Servers
  • Non-Blocking Sockets

Appendix A. Learning Resources

System Requirements

Hardware Requirements (Minimum) 500 MHz, 256 meg RAM, 500 meg disk space.
Hardware Requirements (Recommended) 1 GHz, 512 meg RAM, 1 gig disk space.
Operating System Tested on Windows XP Professional. Course software should be viable on all systems which support a Java 6 Developer's Kit.
Network and Security Limited privileges required -- please see our standard security requirements.
Software Requirements All free downloadable tools.