NetBeans IDE provides a unique capability for learning and understanding best practices for Java application development with its integration of the Java BluePrints Solutions Catalog. The Java BluePrints Solutions Catalog has long been accepted as the source of Java application best practices and Java suggested guidelines. The Java BluePrints Solutions Catalog also illustrates these best practices and guidelines through various example applications. It provides a huge repository of example applications from which you can literally cut and paste source code or tailor code for your own specific application. In NetBeans IDE, you can directly access the catalog and install example Java BluePrints Solutions directly into the IDE as a new project. This feature provides you a unique opportunity to learn and understand quickly various Java BluePrints best practices and recommended guidelines.
In the NetBeans IDE 5.0 release, the following Java BluePrints Solutions are available, grouped into three categories:
Accessing the Java BluePrints Solutions CatalogWhen you install NetBeans IDE, the Java BluePrints Solutions Catalog is available without any additional installation steps. You can access the catalog by choosing Help | Java BluePrints Solutions Catalog. The catalog is displayed in the IDE's main document area (where the Source Editor also appears) as shown in Figure 10-3. Figure 10-3. Java BluePrints Solutions Catalog in NetBeans IDE main window
Navigating the Java BluePrints Solutions CatalogBecause the Java BluePrints Solutions Catalog displayed in the NetBeans IDE main window follows the browser paradigm, it is easy to navigate. You will notice a drop-down list from which you can select different Java BluePrints solutions (see Figure 10-4). Figure 10-4. Java BluePrints Solutions Catalog with the combo box listing the different solutions availableThe solutions are grouped into categories, within which you can navigate by clicking the Back or Forward buttons. You can also use the drop-down list to select a specific solution within a category. When a specific Java BluePrints Solution is selected, there are three tabs to choose among, as shown in Figure 10-5. Figure 10-5. A blueprint with the Solution tab selectedThe Solution tab displays a description of the issue the Java BluePrints Solution is trying to solve. The Design tab describes the design of the solution so you can understand the implementation decisions made and the design best practices used in the solution. The Example tab allows you to install an example implementation of the Java BluePrints Solution in NetBeans IDE as a NetBeans project. To view the solution, design or install an example as a NetBeans project for a given Java BluePrints Solution, simply select the appropriate tab. Creating an example project is a very useful capability, because it allows you to see a running, working example implementation of the Java BluePrints Solution by being able to run or even debug the solution. In addition, it is very easy to pull source code from a working implementation into your own specific application or project. Creating a NetBeans Project from a Java BluePrints SolutionThis section describes the steps for installing a Java BluePrints Solutions example in NetBeans IDE as a NetBeans project. In addition, the section describes how to run the example once it is installed as a NetBeans project. To install a Java BluePrints Solution from the Java BluePrints Solutions Catalog:
Once you have the Java BluePrints Solution created as a NetBeans IDE project, you can perform operations such as building, deploying, and debugging.
Running a Java BluePrints Solutions ProjectTo run a NetBeans IDE project that has been created from the Java BluePrints Solutions Catalog, you perform the same operations as you would when running other Java EE applications in the IDEthat is, you open the Projects window, right-click the newly created project for your Java BluePrints Solution, and choose Run Project. NetBeans IDE will build the newly created Java BluePrints Solutions project, deploy it to the target server, and load the application's home page in your default web browser automatically. Once you have the Java BluePrints Solution created as a project in NetBeans IDE, you can perform a large number of operations. For example, you can deploy the application to your target server, as you have already seen; you can run the application in a debugger; you can use the HTTP Monitor to analyze the HTTP requests that are passed between your browser and the deployed application; and you can make changes to the source files by editing the project source. In fact, using the Java BluePrints Solutions Catalog and one of its applications is an excellent way to learn some of the Java EE technologies and best practices on how to use the technologies. In addition, these solutions are an excellent source from which you can cut and paste code for an application you are developing. |