I’m working on a Android project which six packages (which commanicate between them) with at least 5 classes in each of them.
I’m trying to optimize my project in order to change my Application Structure and to make it as generic and reliable as possible. Thus, I’m trying to reduce the number of package.
Is it recommanded to have a project with few packages? In other word, what are the consequences (especially on the project execution) of having a lot of packages?
Packages are mainly a convenient way of organising a project with a functionnal or technical separation.
There was an interesting article about optimisation a long time ago on android developer blog where it was mentionned that getter and setter were to be avoided. So relying on public field members was the way to go (http://developer.android.com/training/articles/perf-tips.html). To prevent things to become messy, a programmer reflex would be to “protect” the fields (ie protected) from an acces from another package. With current jit compiler optimizations this is not true anymore. So working with the less packages possible is not really making sense. For the sake of clarity, i would suggest to create as much packages as needed.