Should package structure closely resemble class hierarchy?

Posted by Panzercrisis on Programmers See other posts from Programmers or by Panzercrisis
Published on 2013-11-13T01:53:03Z Indexed on 2013/11/13 4:11 UTC
Read the original article Hit count: 203

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?

© Programmers or respective owner

Related posts about architecture

Related posts about packages