| About the Authors | p. xi |
| About the Technical Reviewer | p. xiii |
| Acknowledgments | p. xv |
| Introduction | p. xvii |
| Introduction and General Development Considerations | |
| Introduction | p. 3 |
| J2SE 5 | p. 3 |
| The SCJD Exam | p. 4 |
| The Certification Process | p. 4 |
| Downloading the Assignment | p. 5 |
| Documentation and Questions | p. 5 |
| Who Should Read This Book | p. 6 |
| About This Book | p. 6 |
| Setting Up the J2SE 5 JDK and Environmental Variables | p. 8 |
| Summary | p. 8 |
| FAQs | p. 8 |
| Project Analysis and Design | p. 11 |
| Implementing a Project | p. 11 |
| Getting Started | p. 12 |
| Gathering Requirements | p. 12 |
| Using Accepted Design Patterns | p. 14 |
| Documenting Design Decisions | p. 15 |
| Testing | p. 15 |
| Organizing a Project | p. 16 |
| High-Level Documentation | p. 17 |
| Design Decisions Document | p. 18 |
| Java Coding Conventions | p. 19 |
| Naming Conventions | p. 20 |
| File Layout | p. 22 |
| Source Code Formatting | p. 24 |
| Formatting of Comments Within the Code | p. 28 |
| Suggested Coding Conventions for New Features in JDK 5 | p. 29 |
| Javadoc | p. 35 |
| Coding Conventions | p. 36 |
| Working with Packages | p. 44 |
| Best Practices | p. 47 |
| Writing Documentation As You Go | p. 47 |
| Assertions | p. 49 |
| Logging | p. 50 |
| Summary | p. 54 |
| FAQs | p. 54 |
| Project Overview | p. 57 |
| What Are the Essential Requirements for the Sun Certification Project? | p. 57 |
| Introducing the Sample Project | p. 59 |
| Application Overview | p. 63 |
| Summary | p. 66 |
| FAQs | p. 66 |
| Implementing a J2SE Project | |
| Threading | p. 71 |
| Threading Fundamentals | p. 71 |
| A Brief Review of Threads | p. 72 |
| Multithreading | p. 73 |
| Java's Multithreading Concepts | p. 73 |
| Locks | p. 87 |
| Locking in JDK 5 | p. 96 |
| Locking Summary | p. 98 |
| Understanding Thread Safety | p. 98 |
| Deadlocks | p. 98 |
| Race Conditions | p. 100 |
| Starvation | p. 102 |
| Understanding Atomic Operations | p. 104 |
| Thread Safety Summary | p. 106 |
| Using Thread Objects | p. 106 |
| Stopping, Suspending, Destroying, and Resuming | p. 106 |
| Thread States | p. 107 |
| More on Blocking | p. 108 |
| Synchronization | p. 111 |
| Multithreading with Swing | p. 113 |
| Threading Best Practices | p. 114 |
| Summary | p. 116 |
| FAQs | p. 116 |
| The DvdDatabase Class | p. 119 |
| Creating the Classes Required for the DvdDatabase Class | p. 119 |
| The DVD Class: A Value Object | p. 119 |
| Discussion Point: Handling Exceptions Not Listed in the Supplied Interface | p. 126 |
| The DvdDatabase Class: A Facade | p. 134 |
| Accessing the Data: The DvdFileAccess Class | p. 137 |
| Discussion Point: Caching Records | p. 148 |
| The ReservationsManager Class | p. 148 |
| Discussion Point: Identifying the Owner of the Lock | p. 150 |
| Creating Our Logical Reserve Methods | p. 154 |
| The Logical Release Method | p. 155 |
| Summary | p. 160 |
| FAQs | p. 160 |
| Networking with RMI | p. 163 |
| What Is Serialization? | p. 164 |
| Using the serialver Tool | p. 165 |
| The Serialization Process | p. 166 |
| Customizing Serialization with the Externalizable Interface | p. 169 |
| Introducing RMI | p. 171 |
| The Delivery Stack | p. 173 |
| The Pros and Cons of Using RMI as a Networking Protocol | p. 174 |
| The Classes and Interfaces of RMI | p. 175 |
| What Is an RMI Factory? | p. 177 |
| Summary | p. 196 |
| FAQ | p. 196 |
| Networking with Sockets | p. 199 |
| Socket Overview | p. 199 |
| Why Use Sockets | p. 200 |
| Socket Basics | p. 200 |
| Addresses | p. 200 |
| TCP and UDP Sockets Overview | p. 201 |
| TCP Socket Clients | p. 203 |
| The DvdSocketClient | p. 205 |
| Socket Servers | p. 212 |
| Multicast and Unicast Servers | p. 212 |
| Multitasking | p. 212 |
| The Server Socket Class | p. 213 |
| The Application Protocol | p. 218 |
| Summary | p. 222 |
| FAQs | p. 222 |
| The Graphical User Interfaces | p. 225 |
| GUI Concepts | p. 226 |
| Layout Concepts | p. 227 |
| Human Interface Concepts | p. 228 |
| Model-View-Controller Pattern | p. 234 |
| Why Use the MVC Pattern? | p. 234 |
| MVC in Detail | p. 234 |
| Benefits of MVC | p. 236 |
| Drawbacks of MVC | p. 236 |
| Alternatives to MVC | p. 237 |
| Swing and the Abstract Windows Toolkit | p. 237 |
| Layout Manager Overview | p. 237 |
| Look and Feel | p. 241 |
| The JLabel Component | p. 244 |
| The JTextField Component | p. 245 |
| The JButton Component | p. 248 |
| The JRadioButton Component | p. 249 |
| The JComboBox Component | p. 251 |
| The BorderFactory | p. 251 |
| The JTable Component | p. 254 |
| The TableModel | p. 255 |
| Using the TableModel with a JTable | p. 259 |
| The JScrollPane | p. 260 |
| Bringing Denny's DVDs Together | p. 262 |
| Application Startup Class | p. 262 |
| The Client GUI | p. 263 |
| Specifying the Database Location | p. 273 |
| The Server GUI | p. 286 |
| Swing Changes in J2SE 5 | p. 289 |
| Improve Default Look and Feel of Swing | p. 289 |
| Skins Look and Feel | p. 290 |
| Adding Components to Swing Containers Has Been Simplified | p. 290 |
| Summary | p. 291 |
| FAQs | p. 291 |
| Wrap-Up | |
| Project Wrap-Up | p. 295 |
| Thread Safety and Locking | p. 296 |
| The Choice Between RMI and Sockets | p. 296 |
| Benefits of Using a Serialized Objects Over Sockets Solution | p. 297 |
| Benefits of Using an RMI Solution | p. 299 |
| The MVC Pattern in the GUI | p. 300 |
| Locating the Code Samples | p. 301 |
| Compiling and Packaging the Application | p. 301 |
| Creating a Manifest File | p. 303 |
| Running rmic on the Remote Package | p. 304 |
| Packaging the Application | p. 305 |
| Running the Denny's DVDs Application | p. 306 |
| Running the Client Application in Stand-alone Mode | p. 307 |
| Running Denny's DVDs Server | p. 307 |
| Running the Client Application in Networked Mode | p. 309 |
| Testing | p. 309 |
| Packaging Your Submission | p. 318 |
| Summary | p. 321 |
| FAQs | p. 322 |
| Index | p. 325 |
| Table of Contents provided by Ingram. All Rights Reserved. |