Chapter 2. Configuring your (Maven) Project

Table of Contents

2.1. Structure of a Naked Objects Application
2.2. Updating the Main Project
2.3. Updating the DOM Project
2.3.1. Source folders
2.3.2. Updating the Maven POMs
2.3.3. Configuring Eclipse IDE
2.3.4. Other IDEs
2.4. Updating the Fixture and Service Projects
2.5. Updating the Commandline and/or Webapp Project

Abstract

Groovy Objects is provided as a Maven module. In this chapter we explain the configurations steps necessary to update your Maven-based domain application, and how to configure a common IDE so you can program in Groovy with Naked Objects.

2.1. Structure of a Naked Objects Application

The typical structure for a Naked Objects Maven-based application (and the one you'll end up with if you use Naked Objects' Maven application archetype) is:

  • app

    Main (parent) module, whose pom.xml references the submodules

  • app/dom

    Domain object model, plus interfaces for services, repositories and factories

  • app/service

    Implementation of services, repositories and factories

  • app/fixture

    Fixtures, used to seed (in-memory) object store when running in exploration/prototype mode

  • app/commandline

    Bootstrap for running from the command line (typically, the DnD viewer or HTML viewer)

  • app/webapp

    Packaging and running as a web application

The application is normally run either from the commandline project, using the org.nakedobjects.runtime.NakedObjects main class (where the viewer to use is specified using the --viewer flag), or from the webapp project (picking up web.xml for bootstrapping as a web application),