John Hunt and Alex McManus. Key Java. Advanced Tips and Techniques

Similar documents
Index. Enterprise JavaBeans 6 error handling 316 messages 318 prevention 316 exceptions 155 Externalizable interface 57

1 OBJECT-ORIENTED PROGRAMMING 1

Introduction... xv SECTION 1: DEVELOPING DESKTOP APPLICATIONS USING JAVA Chapter 1: Getting Started with Java... 1

OracleAS 10g R3: Java Programming

Oracle 10g: Java Programming

E Oracle 10g Java Bootcamp I v1

[Course Overview] After completing this module you are ready to: Develop Desktop applications, Networking & Multi-threaded programs in java.

"Charting the Course... Java Programming Language. Course Summary

Contents. iii Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1998, Revision B

CONTENTS. INTRODUCTION xvii

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

Murach s Beginning Java with Eclipse

COURSE DETAILS: CORE AND ADVANCE JAVA Core Java

CONTENTS. Chapter 1 Getting Started with Java SE 6 1. Chapter 2 Exploring Variables, Data Types, Operators and Arrays 13

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Objective Questions. BCA Part III Paper XIX (Java Programming) page 1 of 5

Contents Introduction 1

Java Training JAVA. Introduction of Java

Implementing a Web Service p. 110 Implementing a Web Service Client p. 114 Summary p. 117 Introduction to Entity Beans p. 119 Persistence Concepts p.

Practitioner Series. Springer London Berlin Heidelberg New York Hong Kong Milan Paris Santa Clara Singapore Tokyo

This page intentionally left blank

Core Java Syllabus. Pre-requisite / Target Audience: C language skills (Good to Have)

Multiple Choice Questions. Chapter 5

List of Examples List of Figures List of Tables. Acknowledgments 1. VERIFICATION GUIDELINES 1

IT6503 WEB PROGRAMMING. Unit-I

Objects First with Java

3. Course Outlines: Specific Objectives Contents Teaching Hours understand the basic concept of java programing. 1. Introduction to Java Language

JAVA. Duration: 2 Months

CS/B.TECH/CSE(OLD)/SEM-6/CS-605/2012 OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

JAVA SYLLABUS FOR 6 MONTHS

Advanced Java Programming

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

MyProgram m i ng Lab. get with the programming. Through the power of practice and immediate personalized

J2EE Technologies. Industrial Training

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Object-Oriented Programming and Data Structures

Spring Persistence. with Hibernate PAUL TEPPER FISHER BRIAN D. MURPHY

ABOUT CORE JAVA COURSE SCOPE:

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

Java Application Development

Internet Application Developer

JOSE LUIS JUAREZ VIVEROS com) has a. non-transferable license to use this Student Guide

Programming with the Java Media Framework

Java SE7 Fundamentals

Introduction. Assessment Test. Part I The Programmer s Exam 1

WA1278 Introduction to Java Using Eclipse

Appendix A - Glossary(of OO software term s)

CHAPTER 1: A GENERAL INTRODUCTION TO PROGRAMMING 1

COURSE SYLLABUS. Complete JAVA. Industrial Training (3 MONTHS) PH : , Vazhoor Road Changanacherry-01.

Page 1

Essential Series. Springer-Verlag London Ltd.

JAVA Training Overview (For Demo Classes Call Us )

Object-Oriented Programming and Java

Table of Contents. Introduction... xxi

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Widget Toolkits CS MVC

Introduction to C++/CLI 3. What C++/CLI can do for you 6 The rationale behind the new syntax Hello World in C++/CLI 13

JAVA CONCEPTS Early Objects

Fundamentals of the Java Programming Language

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

A Java-based Course in Human-Computer Interaction. Eileen Kraemer. The University of Georgia. Athens, GA interface.

FOR BEGINNERS 3 MONTHS

Table of Contents. Chapter 1 Getting Started with Java SE 7 1. Chapter 2 Exploring Class Members in Java 15. iii. Introduction of Java SE 7...


Foundations of object orientation

Java EE Patterns. Student Guide - Volume 1. SL-500 Rev C.0.1. D61856GC10 Edition 1.0 D62465

Java Swing Introduction

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

Peers Techno log ies Pv t. L td. Core Java & Core Java &Adv Adv Java Java

The Java Tutorial. A Short Course on the Basics. Raymond Gallardo. Sowmya Kannan. AAddison-Wesley. Sharon Biocca Zakhour.

ощ 'ршорвшэш! цвн-эориэу ощ 'sajbpossv # PIPG DUJ 'ssjmoossv ^ PIPG pipa w н OX ЛЮН VAV

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate

Bharati Vidyapeeth s Institute of Computer Applications and Management A-4, Paschim Vihar, New Delhi-63.

JAVA MICROSERVICES. Java Language Environment. Java Set Up. Java Fundamentals. Packages. Operations

Beginning Groovy, Grails and Griffon. Vishal Layka Christopher M. Judd Joseph Faisal Nusairat Jim Shingler

Watch Core Java and Advanced Java Demo Video Here:

COWLEY COLLEGE & Area Vocational Technical School

Core Java SYLLABUS COVERAGE SYLLABUS IN DETAILS

The Definitive Guide to. NetBeans Platform 7. Heiko Bock. Apress*

Java Programming Language

ava with Object-Oriented Generic Programming+ Java Java with Object-Oriented + Generic Programming by Paul S. Wang sofpower.com

Peter Sestoft. Java Precisely. Third Edition. The MIT Press Cambridge, Massachusetts London, England

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

ESPRIT Project N Work Package H User Access. Survey

SOFTWARE MODELING AND DESIGN. UML, Use Cases, Patterns, and. Software Architectures. Ki Cambridge UNIVERSITY PRESS. Hassan Gomaa

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

J2EE Interview Questions

Compaq Interview Questions And Answers

OLLSCOIL NA héireann THE NATIONAL UNIVERSITY OF IRELAND COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK. Summer Examination 2013

15CS45 : OBJECT ORIENTED CONCEPTS

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR (ODD SEM)

Big Java Late Objects

Organization of User Interface Software

C# Programming: From Problem Analysis to Program Design. Fourth Edition

JAVA & J2EE UNIT -1 INTRODUCTION

Mastering BEA WebLogic Server Best Practices for Building and Deploying J2EE Applications

CSC 222: Object-Oriented Programming. Fall 2015

Java J Course Outline

Transcription:

John Hunt and Alex McManus Key Java Advanced Tips and Techniques

Preface xiii Part 1 Java Development 1 Introduction 3 1.1 Introduction 3 1.2 A Brief History of Java 3 1.3 The Three Stages of Java 4 1.4 The Java Application Platform 7 1.5 Case Studies 8 1.6 Issues for Java Developers 12 2 Inheritance and Reuse 13 2.1 Introduction 13 2.2 Inheritance 14 2.3 Drawbacks of Inheritance 16 2.4 Balancing Inheritance and Reuse 22 2.5 Compositional Reuse 23 2.6 Promoting Reuse in Object-Oriented Systems 24 2.7 Tool Support 25 2.8 Conclusions 26 2.9 Further Reading 26 3 Persistent Storage of Objects 27 3.1 Introduction 27 3.2 Streams 27 3.3 Serialization 28 3.4 The Object Input/Output Streams 30 3.5 Controlling What is and is not Saved 32 3.6 Version control 32 3.7 Problems with Serialization 33 3.8 Further Reading 34 3.9 Online References 34 4 Introductory JavaBeans 35 4.1 Introduction 35 4.2 Overview 35 vii

viii 4.3 Implementing JavaBeans 38 4.4 Defining JavaBeans 41 4.5 Using the BeanBox and Jar Files 46 4.6 Further Reading 47 4.7 Online References 47 5 JavaBeans in Depth 49 5.1 Introduction 49 5.2 Introspection 49 5.3 Property Data Types 50 5.4 Creating a Beanlnfo Object 54 5.5 Serializing a Bean 56 5.6 Property Editors 57 5.7 Customizers 60 5.8 A Critique of JavaBeans 60 5.9 Summary 62 6 Java DataBase Connectivity 63 6.1 Introduction 63 6.2 WhatisJDBC? 63 6.3 What the Driver Provides 65 6.4 Registering Drivers 65 6.5 Opening a Connection 66 6.6 Obtaining Data from a Database 67 6.7 Creating a Table 69 6.8 Limitations 70 6.9 Further Reading 71 6.10 Online References 71 7 The Web and JDBC 73 7.1 Introduction 73 7.2 MiniSQL 73 7.3 Sockets in Java 74 7.4 Web-Based Client-Server Architecture 75 7.5 Signed Applets 82 7.6 Further Reading 83 7.7 Online References 83 8 File-Based Storage Classes 85 8.1 Introduction 85 8.2 File-Based Storage Classes 85 8.3 Implementing a Fi lebag Class 86 8.4 The Collection Interface 86 8.5 The RangedRandom Class 87 8.6 The UniqueFilename Class 88 8.7 The Fi lebag Class 90 8.8 Online Resources 101

ix 9 Frameworks 103 9.1 Introduction 103 9.2 What is a Framework? 103 9.3 MVC: An Example Framework 104 9.4 The MVC Framework in Java 107 9.5 The Balance Application 110 9.6 The Application Code 112 9.7 Designing Object-Oriented Frameworks 116 9.8 General Guidance for Framework Development 118 9.9 Further Reading 118 10 Patterns for Documenting Frameworks 119 10.1 Introduction 119 10.2 Motivation Behind Patterns 119 10.3 Design Patterns 120 10.4 Documenting Patterns 121 10.5 When to Use Patterns 123 10.6 Strengths and Limitations of Design Patterns 123 10.7 An Example Pattern: Mediator 124 10.8 Summary 128 10.9 Further Reading 129 10.10 Online References 129 Part 2 Java Testing 11 Testing Object-Oriented Systems 133 11.1 Introduction 133 11.2 Why is Testing Object-Oriented Systems Hard? 133 11.3 Inheritance *. 136 11.4 Abstract Superclasses 140 11.5 Encapsulation 141 11.6 Polymorphism 143 11.7 Additional Java-Specific Features 145 11.8 Summary 145 11.9 Further Reading 146 12 Testing Java Code.. 147 12.1 Introduction 147 12.2 Class and Instance Sides 147 12.3 Sources of Test Information 150 12.4 Object Integration Testing 151 12.5 System Testing 151 12.6 Summary 152 12.7 Further Reading 152 13 Assertions in Java 153 13.1 Introduction 153

x Part 3 13.2 Assertions and Their Uses 153 13.3 Using Assertions in Java 154 13.4 Assertions in Java 156 13.5 CheckedAssertion and CheckedAssertionException 158 13.6 Analysis 159 13.7 Summary 160 13.8 Further Reading 160 Java Performance 14 Performance: Tooling Up 165 14.1 Introduction 165 14.2 The Java Language 165 14.3 Virtual Machines 166 14.4 Java Compilers 169 14.5 Targeting Optimization 170 14.6 Profiling 172 14.7 Summary 173 14.8 Online References 173 15 Optimizing for Speed 175 15.1 Introduction 175 15.2 Timing Harnesses 175 15.3 System Library Classes 179 15.4 Traditional Optimizations 184 15.5 The Cost of Java Operations 185 15.6 Rewriting Library Classes 191 15.7 Summary 192 15.8 Online References 192 15.9 References 193 16 Optimizing for Memory 195 16.1 Introduction 195 16.2 Reducing Class File Size 195 16.3 Memory Management 198 16.4 Strategies for Reducing Memory Overhead 201 16.5 Summary 204 16.6 Further Reading 205 16.7 Online References 205 17 Future Evaluators 207 17.1 Exploiting Idle Processor Time 207 17.2 Processes in Java 208 17.3 Inter-process Communication 209 17.4 Implementing Future Evaluators 210 17.5 Working with Future Evaluators 212

xi 17.6 Lazy Evaluators 214 17.7 Native Threads 214 17.8 Summary 214 17.9 Online References 215 18 Real-Time Java 217 18.1 Introduction 217 18.2 What are Real-Time Systems? 217 18.3 Language Requirements 218 18.4 Java for Real-Time Systems 218 18.5 Summary 221 18.6 Further Reading 221 Part 4 Graphic Java 19 Evolution of the Java User Interface 225 19.1 Introduction 225 19.2 The Abstract Window Toolkit 225 19.3 The Internet Foundation Classes 227 19.4 Other Contributions 228 19.5 The Java Foundation Classes 229 19.6 Summary 230 19.7 Online References 230 20 The Internet Foundation Classes 233 20.1 Introduction 233 20.2 Application Framework 233 20.3 View Classes 236 20.4 Layout Managers 242 20.5 Windows 243 20.6 Persistence 244 20.7 IFC Constructor 244 20.8 IFC and AWT 246 20.9 Migration to the Java Foundation Classes 246 20.10 Summary 247 20.11 Online References 247 21 Swinging with the Java Foundation Classes 249 21.1 Introduction 249 21.2 Model-View-Controller Architecture 250 21.3 Pluggable Look and Feel 251 21.4 Swing Components 254 21.5 Windows 260 21.6 Common Dialogs 261 21.7 Extending Swing Components 263 21.8 Creating New Swing Components 265 21.9 Actions 266

xii 21.10 Undo Framework 269 21.11 Java Accessibility 274 21.12 Summary 275 21.13 Online References 275 22 Graphical Java Media 277 22.1 Introduction 277 22.2 Java 2D 277 22.3 Java 3D 287 22.4 The Java Media Framework 294 22.5 Summary 299 22.6 Online References 299 23 User Interface Design Issues in Java 301 23.1 Introduction 301 23.2 Users and Tasks 301 23.3 General Guidelines for Good Design 306 23.4 Consistency 309 23.5 Menus 312 23.6 Dialogs 314 23.7 Error Handling 316 23.8 Internationalization 319 23.9 Response Time 322 23.10 Screen Design and Colour 323 23.11 Help! 323 23.12 Configuration 324 23.13 Platform Independence 325 23.14 Summary 325 23.15 Further Reading 326 23.16 Online References 326 Index 327