ebook img

Professional Java User Interfaces PDF

673 Pages·2006·26.119 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Professional Java User Interfaces

ffirs.fm Page ii Wednesday, March 8, 2006 10:40 AM 10:39 AM 8 March 2006 ffirs.fm 1.0 front_inter_cover.fm Page i Friday, March 10, 2006 2:12 PM Main Patterns and Design Strategies organized by functional layer 2:9 PM 10 March 2006 front_inter_cover.fm 1.0 front_inner_paper.fm Page i Wednesday, March 8, 2006 12:29 PM Main principles • GUI design and overall development – User-centered design (44) A design approach for building highly usable user interfaces, putting the emphasis on the user. – Cost-driven design (81) GUI design comes first, with an eye on development complexity. For example, avoid using ad-hoc components (81) in your GUI as far as possible. – Iterative GUI development (169) Iterate: GUI design and implementation, profiling, software and usability testing. • Implementation – The principle of Single Functional Responsibility (227) Provide only one functional responsibility per class/method. – Object lifecycle management – a general mindset (281) Instantiate lazily and dispose eagerly, avoid garbage collector bottlenecks. – Don’t go against the flow (284) GUI toolkits are complex beasts, so don’t ignore them and implement fancy designs counter to the architecture or style of the underlying GUI toolkits and infrastructure (RCP). Visual refactorings Other refactorings are discussed in Chapter 5. • Extract explicit panel (195), Extract stand-alone panel (196), and Composable units (292) Extract the code of an existing GUI panel into a separate implementation to enhance modularity and reusability. • Merge panel (197) Merge different implementations representing the same panel into a common one. • Add parameter to panel (197) and Remove parameter from panel (198) Add parameters to customize a panel and its opposite refactoring, Remove parameter from panel (198). • Parameterize panel (199) Implement two slightly different panels with a unique code base. • Replace parameter with panel (200) Instead of adding a parameter, separate the implementation of the two panels. • Rename panel (201) Change the name of a panel. 12:20 PM 8 March 2006 front_inner_paper.fm 1.0 back_inner_paper.fm Page 758 Wednesday, March 8, 2006 12:30 PM Cheat Sheet An extremely simplified and by no means exhaustive basic reference to some of the topics discussed in the book. GUI Design • How do I signal to the user my GUI is busy? Change mouse pointer to hour glass for any operation that lasts more than two seconds, always use progress indicators, and update progress every five seconds. • How do I validate my GUI? Involve users in design, use prototyping, software testing, memory profiling (Chapter5), questionnaire evaluation (Appendices A and B), and usability testing. • How do I organize the GUI window area? Use the Area Organization design strategy (120). • How do I allow the user to select or create information in a GUI? Use the Chooser design strategy, 126. • How do I deploy my GUI? Use Java Web Start when the user population is confident with approving certificates, as for internal software. Use installers in other cases, and for large installation bundles. Consider also using applets! Software Design • How do I keep my GUI responsive to user interaction during long-running operations? Use the Active Object pattern, 280 (for Swing, the SwingWorker class) for any opera- tion that might last more than one second. • How do I implement control (reaction to user interaction) in my GUI? Depending on the number of items to be controlled by control rules, use: – Scattered control (260) – few items, reactive-only control rules. – Centralized control, the Mediator pattern (263) – many items, any kind of control rule. – Explicit Control State (260) – complex control rules, need for flexibility. • How do I implement undo/redo in a GUI? Build a queue or stack of edits (587), use the Command pattern (258) for user actions. • How do I implement role-based authorization/security in my GUI? Build a dedicated authorization manager class using Adaptation (272). 12:30 PM 8 March 2006 back_inner_paper.fm 1.0 back_inner_cover.fm Page 758 Wednesday, March 8, 2006 12:30 PM • How do I implement user customization and user profiles in my GUI? Build a dedicated profile manager class using Adaptation (272). • How do I reuse existing panels in my GUI? Use visual refactorings (194). • How do I organize implementation for modularity and extensibility in a large or complex GUI? Define and implement a Composable Unit strategy, 292. • How do I implement content assembly – adding components to a screen or panel – in a GUI? Depending on the features you want use: – Static assembly (229), for simple layouts, no reusability. – Simple Builders (229), for ease of use, separation of concerns, limited flexibility. – Create and use Domain-specific or Little languages, 466 – good separation, maximum flexibility. • How do I organize complex event-based interactions among objects in my GUI? Use an Event Arbitrator (245) to: – Avoid event loops and rationalize chains of observers-observables. – Shield client classes from low-level events. – Forward events to complex data structures based on the Composite pattern. • How do I handle large data collections? Depending on the context of the problem, use: – Eager disposal (281) of objects that are no longer needed – simple references, extremely large trees. – Weak or soft references, for cached objects and data that can be created or fetched on the fly. – Paging (281) for loading a few pages at time, discarding old ones, such as large table models or large collections of expensive objects. • How do I communicate data remotely in a modular way? Separate screen data state from domain objects using Data Transfer Objects (234). • How do I handle data represented in widgets? Define Screen Data State (SDS, 330) and the widgets that will interface SDS to the user. For synchronization with domain objects data (if any) use: – Manual synchronization of SDS and data, for simple, small GUIs. – Data binding support, for medium to large, complex GUIs. 12:30 PM 8 March 2006 back_inner_cover.fm 1.0 ffirs.fm Page i Wednesday, March 8, 2006 10:40 AM Professional Java User Interfaces 10:39 AM 8 March 2006 ffirs.fm 1.0 ffirs.fm Page ii Wednesday, March 8, 2006 10:40 AM 10:39 AM 8 March 2006 ffirs.fm 1.0 ffirs.fm Page iii Wednesday, March 8, 2006 10:40 AM Professional Java User Interfaces Mauro Marinilli 10:39 AM 8 March 2006 ffirs.fm 1.0

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.