Android Package by features, not layers

Package by features, not layers

“Splitting packages by layers is just like splitting co-workers by profession instead of splitting them into organization teams.”

Imagine this ridiculous situation:

Managers company, Programmers companyHuman Resources companyand Marketing company, where the Programmers company will only have programmers and no managersmarketeers or human resources;

Gains and Benefits

  • By looking at the structure you can already tell what the app is all about (figure 1);
  • Higher modularity;
  • Easier code navigation;
  • Higher level of abstraction;
  • Separates both features and layers;
  • More readable and maintainable structure;
  • More cohesion;
  • Much easier to scale;
  • Less chance to accidentally modify unrelated classes or files;
  • Much easier to add or remove application features;
  • And much more reusable modules.