Reputation: 3207
I've seen the organization below, but was wondering if there are any established conventions or helpful advice for organizing classes and interfaces?
Upvotes: 4
Views: 676
Reputation: 957
There is no hard and fast rule and your mileage may vary...
However, I recommend keeping related public interfaces and implementation code in the same package. In that way, the interfaces, enums, constants, factory classes, or whatever else needs to be publicly available is public
, while implementation classes can be mostly or entirely private
or only package visible. Putting implementation classes in a separate package will force some details to be public
which would not otherwise have to be exposed.
Upvotes: 2