Choosing the Right Project Template


When you open the New Project wizard (File | New Project), you are presented with several templates, the use of which might not be immediately apparent.

Depending on the distribution of the IDE that you have, you might have several categories of templates. See Table 3-1 for the list.

Table 3-1. Project Template Categories

Template Category

Description

General

For desktop applications or Java libraries based on Java 2 Standard Edition.

Web

For web applications based on the Java Enterprise Edition platform. These templates also include support for using the JavaServer Faces (JSF) and Struts web frameworks.

Enterprise

For enterprise tier applications, such as those that include Enterprise JavaBeans components (EJBs) and web services, based on Java 2 Enterprise Edition.

Mobile

For applications targeted toward handheld devices, based on Java 2 Micro Edition.

NetBeans Plug-in Modules

For creating modules that you can use to extend the IDE or to create a rich-client application based on the NetBeans Platform.

Samples

Sample applications that are ready to build and run from the IDE.


For each category, the IDE provides various templates based on the structure of the project and whether you already have sources and/or a fixed Ant script in place.

Standard project templates (all of the templates with the exception of With Existing Ant Script templates) provide maximum integration with the IDE's user interface. However, the use of those templates assumes that your project:

  • Is designed to produce one distributable output (for example, a JAR or WAR file)

  • Will use the Ant script that the IDE has generated for you (although you can customize this Ant script)

If either of those things is not true of your project, you can do one or more of the following:

  • Create individual projects for each output and declare dependencies between the projects.

  • Modify the generated Ant script to add or override targets.

  • Use a With Existing Ant Script (or free-form) template (marked with a icon to create your project).

The free-form templates offer you more flexibility in structuring your project. However, when you use a free-form template, you have to do some extra configuration and write build targets to get some IDE functionality (like debugging) to work. See Chapter 16 for more information on free-form projects.

This chapter mainly covers general Java projects created from standard templates. There is also some information on web projects, though web projects are covered in more detail in Chapter 8. See Chapter 11 for information on setting up EJB projects, Chapter 12 for web service projects, Chapter 13 for Java EE application projects, and Chapter 14 for Java ME projects.



NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net