27114-8 The first true design book inspired by Java(tm) Meet Charlie and Zoe, two users with highly individual User Interface needs. Follow them through the process of designing complex systems that use the power of Java to create unique online solutions. They'll introduce you to the brand-new design paradigm made possible by Java. Explore new concepts in development on the theoretical level, then put them to work with Charlie and Zoe to see their practical applications. Java-inspired design has some basic maxims that are carried out throughout this book. *Interfaces: Java's most significant aspect for designers is its freedom. Object connections and scenario interactions don't need to be hardwired to a single class of objects anymore-learn to use this freedom to gain flexibility, extensibility, and pluggability in your designs. *Composition: Basing your Java designs on composition, rather than inheritance, allows you to maximize this free structure. Java Design offers a five-fold checklist for determining which strategy is "the better one to apply." *Threads: Learn to manage multiple streams of program execution cleanly, efficiently, and safely.* Notification: Manage notification in ways that maximize the loose coupling supported by Java. Learn to identify the flaws in Java's own mechanism to keep your systems in sync. Java Design also includes a CD-ROM filled with cool code ready to use in your own apps, as well as a Strategies and Patterns Handbook with 177 strategies and 31 object-model patterns to guide your own app design.
Table of contentsWhy Java Design?
Design. Java-Inspired Design. A Design Book. The Companion CD-ROM. How to Get Updates. Feedback, Hands-on Workshops, and Mentoring.
Chapter 1: Design by Example.
Five Major Activities. Example, Example, Example. Charlie's Charters. Identify the Purpose and Features. Select the Classes. Sketch a UI. Work Out Dynamics with Scenarios. Build a Class Diagram. Zoe's Zones. Identify the Purpose and Features. Selecting Classes. Sketch a UI. Work Out Dynamics with Scenarios. Build a Class Diagram. Summary.
Chapter 2: Design with Composition, Rather than Inheritance.
Composition. Composition: An Example. Inheritance. Inheritance vs. Interfaces. Inheritance: An Example. Inheritance: Benefits. Inheritance: Risks. Inheritance: When to Use It. Inheritance: Checkpoints. Example: Composition (the Norm). Example: Both Composition and Inheritance. Example: Inheritance (the Exception). Example: Inheritance in Need of Adjustment. Example: Thread. Example: Applet. Example: Observable. Summary.
Chapter 3: Design with Interfaces.
What Are Interfaces? Why Use Interfaces? The Problem. A Partial Solution. Flexibility, Extensibility, and Pluggability-That's Why. Factor-out Interfaces. Factor Out Repeaters. Factor Out to a Proxy. Factor Out for Analogous Apps. Factor Out for Future Expansion. A Short Interlude: Where to Add Interfaces. Design-in Interfaces. Design-in Interfaces Based on Common Features. Design-in Interfaces Based on Role Doubles. Design-in Interfaces Based on Behavior Across Roles. Design-in Interfaces Based on Collections and Members. Design-in Interfaces Based on Common Interactions. Design-in Interfaces Based on Intra-Class Roles. Design-in Interfaces Based on a Need for Plug-in Algorithms . Design-in Interfaces Based on a Need for Plug-in Feature Sequences. Design with Interfaces: Applying Multiple Strategies. Designing-in Flexibility Is a Very Good Thing. Yet There Usually Is a Design Tradeoff: Simplicity vs. Flexibility. Naming Interfaces Revisited. What Java Interfaces Lack. Summary.
Chapter 4: Design with Threads.
Threads. What Is a Thread? How Do Threads Get Started? Why Use Multiple Threads? If You Don't Need Multiple Threads, Don't Use Them. Sync. Sync: A Guarantee and a Nonguarantee. Sync: Scope. Shared Value (and Keeping Out of Trouble). Don't Sync Longer Than You Have To. Shared Resource (and Keeping Out of Trouble). Multiple Clients, Multiple Threads within an Object. Multiple Thread Objects, Multiple Threads within an Object. Single Thread. Prioritized-Object Threads. Prioritized-Method Threads. Prioritized-Method Prioritized-Object Threads. Overall Point. Interface Adapters . Need. One Approach: Dispatcher . A Better Approach: Interface Adapters. What an Interface Adapter Looks Like. Interface Adapters for Zoe's Zones. A Zone-Monitoring Thread. A Sensor-Assessing Thread and a Sensor-Monitoring Thread. Summary.
Chapter 5: Design with Notification.
Passive Notification. Timer-Based Notification. Timer-Notification Pattern. A Timer for Charlie's Charters . Active Notification. Observable-Observer. Source-Listener. Source-Support-Listener (JavaBeans-Style Notification). Producer-Bus-Consumer (InfoBus-Style Notification). Model-View-Controller (Swing-Style Notification). Source-Distributed Listeners (Enterprise JavaBeans-Style Notification). Summary.
Appendix A Design Strategies. Appendix B Notation Summary. Appendix C Java Visibility. Bibliography. Index.