views:

508

answers:

2

Do you have any good tips on how should i organize class packages for my java project?

We are usually building web MVC projects and our structure is something like this

com.company.project.model.* - all model classes com.company.project.service.* - all service classes com.company.project.service.entity.* - service classes related to particular model class com.company.project.service.dao.* - dao classes

this seems somehow smelly tho...

+1  A: 

When using a modern IDE, it probably won't make much difference to the developer - personally I add the package the first time I need it using Eclipse, and forget about it afterwards. From a performance perspective, you don't gain anything by listing only the classes you need - using the * notation does not result in more memory used or slowing down of the application.

simon
A: 

we also do it the lazy way, just add a package if you need one, i think you´ll find a class faster if you have more packages...

Tobiask