Friday, December 16, 2011

JAX-RS Tip of the Day: NetBeans Project Layout Recommendations

When developing a JAX-RS project using NetBeans, I have a couple of simple recommendations. This will hopefully save you some time up front.

  1. First create a JavaJava Class Library project.
    This project will be used to contain classes we expect to share between the service and the client.
  2. Create a second project Java WebWeb Application.
    This project will serve as our REST service application.
  3. Add the first project to the second project.
  4. (Optional) Create a JavaJava Application
    This final project will be used for as our client application.
  5. (Optional) Add the first project to the client project.

The most important part of the recommendation is to make sure that you have a separate library project. The shared code can later be used in multiple projects without refactoring later.

Here is an example project that meets the recommendations above. It was created with NetBeans 7.1 RC2.


Popular Posts