Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package vs project separation in java

First off, I'm coming (back) to Java from C#, so apologies if my terminology or philosophy doesn't quite line up.

Here's the background: we've got a growing collection of internal support tools written for the web. They use HTML5/AJAX/other buzzwords for the frontend and Java for the backend. These tools utilize a lightweight in-house framework so they can share an administrative interface for security and other configuration. Each tool has been written by a separate author and I expect that trend to continue, so I'd like to make it easy for future authors to stay "standardized" on the third-party libraries that we've already decided to use for things like DI, unit testing, ORM, etc.

Our package naming currently looks like this:

  • com.ourcompany.tools.framework
  • com.ourcompany.tools.apps.app1name
  • com.ourcompany.tools.apps.app2name

...and so on.

So here's my question: should each of these apps (and the framework) be treated as a separate project for purposes of Maven setup, Eclipse, etc?

We could have lots of apps appear here over time, so it seems like separation would keep dependencies cleaner and let someone jump in on a single tool more easily. On the other hand, (1) maybe "splitting" deeper portions of a package structure over multiple projects is a code smell and (2) keeping them combined would make tool writers more inclined to use third-party libraries already in place for the other tools.

FWIW, my initial instinct is to separate them.

What say you, Java gurus?

like image 512
super_seabass Avatar asked Jul 02 '12 16:07

super_seabass


1 Answers

I would absolutely separate them. For the purposes of Maven, make sure each app/project has the appropriate dependencies to the framework/apps so you don't have to build everything when you just want to build a single app.

like image 109
Kevin Mangold Avatar answered Sep 29 '22 18:09

Kevin Mangold