Should package structure closely resemble class hierarchy?
- by Panzercrisis
Pretty simple question. Should package structure closely resemble class hierarchy? If so, how closely? Why or why not?
For instance, let's say you've got class A and class B, plus class AFactory and class BFactory. You put class A and class B in the package com.something.elements, and you put AFactory and BFactory in com.something.elements.factories. AFactory and BFactory would be further down the hierarchy package-wise, but they'd be further up class-wise. Is this sort of thing a good idea or a bad idea?