Matthew is a DZone employee and has posted 155 posts at DZone. You can read more from them at their website. View Full User Profile

Rich Client Programming: Plugging into the NetBeans Platform

09.10.2007
| 7779 views |
  • submit to reddit
Published by: Prentice Hall
ISBN: 12121212

Reviewer Ratings

Relevance:
4

Readability:
4

Overall:
4

Buy it now

One Minute Bottom Line

This book is admirable in its completeness and its clarity. The examples are well illustrated and coherent. One might have wished for a little more continuity within the examples - though individual chapter examples are well chosen, they do not build over the entire text to a whole. This is left for two "use case" chapters, which although well written are insufficient to bear such a burden. The writing is a bit dense (be prepared to read some sentences very carefully to understand all they are trying to say). The focus of the text on both the hows and the whys of what needs to be done is admirable, however, and many bits of sage advice that are clearly the result of years of working with the platform shine through. If there is anything really unfortunate about the text, it is in the timing of its publication. This text takes on the task of explicating the sometimes quite different APIs of NetBeans versions 5.5 and 6.0. This can lead to confusion about what API is the appropriate one to use, as NetBeans is being a bit torpid in releasing version 6.0. However, this is certainly neither the book's nor the author's fault, and they have done the best that probably could have been done to expose the new functionality, which will be very useful to those who opt for that version of the platform.

Review

Chapter 1 (Getting Started with the NetBeans Platform) introduces the NetBeans IDE, which will be the basis for developing rich client modules in NetBeans, but will also be the platform used to create those modules. Obtaining NetBeans, installing it, and the most basic steps of creating a module within it are touched upon.

Chapter 2 (The Benefits of Modular Programming) begins the discussion of modularity. Few pieces of software today are built entirely from scratch, without supporting libraries of functionality. Open-source libraries (like NetBeans itself) make an especially compelling case for reuse. Development of applications is often as much a matter of assemblage as creation. The discussion of issues involved with library versioning and modular design is especially well considered.

Chapter 3 (Modular Architecture) continues the discussion of modularity. The text defines different types of modules, explicates design principles applying to modules, examines dependencies of modules upon one another, and covers the lifecycle of NetBeans modules.

Chapter 4 (Loosely Coupled Communication) emphasizes an approach to designing modules with minimal dependencies. NetBeans incorporates the idea of service lookup, common from the Java JDK 1.3. NetBeans contains the Lookup class, which simplifies and regularizes the process of locating extension points (classes that implement a modular interface and expose its functionality).

Chapter 5 (Lookup) furthers discussion of the Lookup class, which can be used to decouple far more than module interfaces. By implementing a pattern whereby one module uses the Lookup class to obtain copies of needed classes and interface implementations, the module developer can reduce to a minimum the dependencies of one module on others, and allow for the graceful degradation of services in environments where needed classes are not available. This also allows for modules to grow in functionality without breaking backward compatibility.

Chapter 6 (Filesystems) describes the abstraction NetBeans uses for the underlying file system, which can be extended to things that are not truly files. The FileSystem and FileObject abstractions enable a number of useful functionalities, including I/O, registering metadata, and listening for change events. The NetBeans directories are treated as extension points, allowing for mappings between directories and the functionality registered there, and the System FileSystem manages these extension points.

Chapter 7 (Threading, Listener Patterns, and MIME Lookup) brings us to the first actual implementation of a module. Though simple, it illustrates many of the points so far made. In addition, it exposes the issues that parts of NetBeans functionality to come are intended to help resolve. Having written more code than needed, the developer will appreciate the more the NetBeans abstractions found in the succeeding chapters.

Chapter 8 (The Window System) presents the basics of the NetBeans user interface (UI) abstraction, and in particular the TopComponent class, which bounds the UI for a particular module. TopComponent is able to persist state across sessions, and multiple TopComponents can be combined into a TopComponentGroup.

Chapter 9 (Nodes, Explorer Views, Actions, and Presenters) continues the presentation of UI abstractions. These include the Node, an abstraction of a node in a tree; nodes represent data displayed to the user. The Explorer API works with nodes to construct visual representations of data: trees, lists, property sheets, and so forth. Similarly, an Action represents functionality that can be initiated by the user, but without visual representation; a Presenter gives the developer a variety of options for visual representation of actions.

Chapter 10 (DataObjects and DataLoaders) rolls out the Datasystems API, which builds upon the Filesystems API a layer of programmatic access to the contents of files. DataObjects are created by DataLoaders, and can perform necessary functions such as creating instances of interfaces it knows about, or supplying a representation of the structure of a file. The chapter example creates a new JAR manifest file type (technically, of course, a JAR manifest is not a file, exactly; it is a portion of a file - this illustrates the idea of extending the Filesystem to treat objects other than files as though they were files).

Chapter 11 (Graphical User Interfaces) declares that "creating GUIs has traditionally been more difficult than it needs to be." The NetBeans GUI Builder (previously project Matisse) introduces new tools that can help make the design of Swing-based forms easier and faster. The chapter example creates a new GUI form, including alignment, resizability, and event handling. Customizing the automatically generated code and configuration files is discussed, as are replacing the default layout managers and even adding your own custom components to the tool.

Chapter 12 (Multiview Editors) starts a series of chapters that introduce features common to modern GUIs but not trivial to implement on your own. The first of these is multiview editors, editors that allow more than one view of a file. The chapter example is a JAR manifest editor that allows directly editing the text of the manifest but also allows a simpler, more visual, view of the contents of the manifest as a properties editor.

Chapter 13 (Syntax Highlighting) continues this series of chapters with syntax highlighting support. This involves creating a lexical analyzer to tokenize files, recognizing those tokens that require syntax highlighting, and assigning colors and fonts to represent the highlighting.

Chapter 14 (Code Completion) sustains the theme of modern GUI features by discussing NetBeans support for code completion in text-based editors. Code completion, potentially offering detailed documentation of what the choices offered mean, is a matter of providing an implementation of the CompletionProvider interface. More advanced functionality includes filtering choices as more input is provided and adding tooltip support.

Chapter 15 (Component Palettes) carries on this theme, introducing component pallets, a common idiom in many modern applications. NetBeans supports component pallets elegantly, including support for typical idioms for accessing pallet contents, including drag-and-drop, double-clicking, and so forth. In addition, NetBeans provides support for pallet filtering, allowing users to determine what relevant entries they wish to see and use.

Chapter 16 (Hyperlinks) raises the issue of navigating through code, within a file or from one file to another. This is accomplished in NetBeans by hyperlinks similar to those employed on web pages. The suggestion to review existing implementations of the HyperlinkProvider class and adapt them to your purpose is especially well taken.

Chapter 17 (Annotations) apprises us of NetBeans's annotation capabilities. This has, of course, nothing to do with Java annotations; it is instead the means by which error or other messages to the user can be represented in place within code. Immediate feedback to users when they enter obviously incorrect input is an extremely valuable and time-saving feature.

Chapter 18 (Options Windows) introduces configuration options within NetBeans. Extending the default Options window can be done in two areas: the existing Micellanous options panel can be extended to include configuration options for your module, or you can add a completely new panel within the Options window. The latter is an excellent option, for instance, if your module has a lot of configurable settings.

Chapter 19 (Web Frameworks) presents NetBeans's support for web frameworks and how to extend it. The chapter example replicates a small portion of the functionality of the existing module that supports the Wicket framework, which has of late been gaining some traction. While it might have been a more useful idea to provide even limited support for a completely new web framework, the example is at least clear. Again, the advice to review existing implementations of the HyperlinkProvider class and adapt them to your purpose is well taken.

Chapter 20 (Web Services) brings us to NetBeans as a web services client. NetBeans automates the process of creating and testing a web services client, making the process very easy, and once the information source is created, implementing the GUI portion falls into by-now-familiar patterns.

Chapter 21 (JavaHelp Documentation) rounds out the discussion of NetBeans features by familiarizing us with its support for JavaHelp. JavaHelp is not specific to NetBeans - it has been a JSR with an open source reference implementation for some time. Creating help text is never the easist part of developing an application, but once created, integrating it into the NetBeans JavaHelp system is very straightforward.

Chapter 22 (Update Centers), finally, brings in a discussion of updating NetBeans installed modules. This is extremely valuable to the user, as they can remain up to date easily and quickly, incorporating important bug fixes and new functionality as they appear. NetBeans support for auto-update is easy enough to add to make it difficult to justify not enabling this feature.

Chapter 23 (Use Case 1: Jens Trapp on NetBeans Module Development) presents a reasonably fully developed use case for adding an HTML Tidy module to NetBeans. If the developer finds this tool useful, this chapter might be worth the cost of the book by itself.

Chapter 24 (Use Case 2: Rick Unger on Application Development) develops another use case, adding a simple WAV file editor to NetBeans. As in the first use case, it reiterates many of the points made earlier in the book in the context of actual application development.

Appendix A (Advanced Module System Techniques) is the "Tips and Tricks" section of the text. Certainly no developer should try to develop a NetBeans module without carefully reading this section.

Appendix B (Common Idioms and Patterns in NetBeans) presents, in its own words, "a hodge-podge of useful coding patterns that are common in NetBeans."

Appendix C (Performance) discusses Swing GUI performance and ways to improve it, especially in a NetBeans environment. Much of the advice would be good for any application and has appeared in other contexts, but for anyone who has not seen it before, it will be invaluable.

Comments

daniel.mendes (not verified) replied on Mon, 2007/09/10 - 4:51pm

great review

Al3ab Co replied on Mon, 2011/09/05 - 1:01am

hello, Great review I used a lot of time netbeans and I think that it's a soo good utility please keep on nice writings, Mike, Soft.Engineer al3ab

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.