Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Which (if either) of the below is the more conventional/acceptable way to structure packages in a J2EE app? I'm trying to follow an MVC pattern as much as possible.

  • foo.bar.users
    • foo.bar.users.servlets
    • foo.bar.users.DAO
    • foo.bar.users.Entity
  • foo.bar.orders
    • foo.bar.orders.servlets
    • foo.bar.orders.DAO
    • etc...

or

  • foo.bar.DAO
    • foo.bar.DAO.users
    • foo.bar.DAO.orders
    • ...
  • foo.bar.servlets
    • foo.bar.servlets.users
    • foo.bar.servlets.orders
    • ...
share|improve this question

closed as not constructive by Mark Trapp Feb 22 '12 at 9:00

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Hi Chris C, naming/organization recommendations are off-topic here: the only thing that matters is agreement amongst your team. –  user8 Feb 22 '12 at 9:02

1 Answer 1

I prefer the second option, for me it have more sense to store package as the architeture model (MVC) and not favour an arrangement based on your specific application logic.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.