I found some questions about how to organise projects (namespace, one class per file etc), but on a more specific note, how do you organize "things" that are very tightly related ?
I usually end up with :
- an interface
IMyStuff
- a base (sometimes abstract) class that provides basic skeletton for that interface :
BaseMyStuff
- implementation classes
MyStuffWithBellsAndWhistles
,MyStuffWithChocolateFlavours
It seems to make sense that they should be in the same namespace, but it feels like my folders start to be a bit over-crowded if I put all these files together in the same folder (not actually a real problem, but it feels strange).
Would it be OK to define both the interface and the base class in the same file ?
Or would it be OK to group those things in sub-folders, but in the same namespace ? like this :
-MyNamespace
|-Interfaces
| -IMyStuff
| -IMyOtherStuff
|-BaseClasses
| -BaseMyStuff
| -BaseMyOtherStuff
|-Implementation
| -MyStuffWithAwesomeBehaviour
| -MyStuffWithGreatUsefulness
| -MyOtherStuffSoNeatYouWillCry
What are the "best practices" regarding this kind of organization ?