On Thu, Apr 21, 2011 at 5:35 PM, xanadu72 <[email protected]> wrote:
> Jochem,David,Jörg, Barrie,
>
> Thanks for your contribution. I'm currently updating my article to take into
> account the feedback received.
> It look like ther is a consensus to invest more time on configuring the
> structure in API/IMPL projects because it's a one time effort offering
> indubitable benefits.
> It is clear as well that the configuration should enforce the clean
> separation for the api user point of view and for the implementation side
> not relying on the good intentions and paper design principles.
>
>
> At that stage two questions remain in my mind :
>
> 1) Should we have a parent project for each tier:
>
> e.g.:
> Business tier project
> Business tier api project
> Business tier impl  project

What would you put in the parent project?
See answer to 2)

> 2) Should we use in that practical case a hierarchical maven project
> structure or a flat structure.

You didn't have a project structure in the email, and I couldn't see
one in your article either. So I'll make some guesses.

Maven prefers a hierarchical structure, you will find some stuff makes
assumptions about layout, e.g. parent > relativePath = ..
(http://maven.apache.org/ref/3.0.3/maven-model/maven.html)
If you make the structure flat you have to specify this value.
Its just easier to layout the project hierarchically, with the parent
always one directory higher.

So your layout would look like:
parent/
- domain/
- ui/
- business-api/
- business/
- persistence-api/
- persistence/

Then in parent/pom.xml setup your dependencyManagement to lock down versions.
In each "modules"/pom.xml setup the correct dependency between your
projects, but don't define versions.
I personally ensure that no <version> tags are set in any
module/pom.xml, this way Maven will fail with an error because you
didn't define the correct dependency in the
parent/pom.xml/dependencyManagement section.  This way there is only
one spot (parent/pom.xml) that contains versions and you only need to
change this once.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to