On Mon, 15 May 2006 23:39:01 -0700, Michael Nemtsev
<Mi************@discussions.microsoft.com> wrote:
Not the number of classes, but their context and logic are major factors for
decoupling classes into different namespaces.
Even if you have 5-7 classes in single app you divide them by context. For
example. classes that are responsible for UI should be detached from those
that are responsible for you logic, and these ones in its turn detached for
Input/Output (data logic) classes
Thanks for your reply, Michael. Yeah, I was curious about how others'
projects end up as far as namespace density. I often end up with one
file per namespace, as you'd expect in some cases, but the only 'Best
Practices' info that I've seen that addresses this (Balena's book)
seems to imply that the average 'solution' will have many more than
I've ended up with. I also expect that to vary by type and diversity
of project
Sometimes I may take the 'context' categorization to too fine a level.
Just wondering about others' thoughts on organizing..
I also often end up with only a couple classes per project. This
happens for a different reason: I often run into occasions where
projects end up cross-dependent, so they need to be split up. Of
course that forces the size of each project to be smaller.
And this gets awkward. The usual thing that I've run into is...
Classes need interfaces as a low-level construct. Then the working
classes are built according to that. Then a top-level class (factory,
whatever) makes use of the working classes, referring to them by
interface.
Basically that results in the lowest and highest strata being built to
an abstraction (Interfaces), with the practical 'worker'
implementation classes in the middle. Fine, except that I'd love to
group the interfaces and factories together into one project--they do
belong together. But alas... circular dependency. This seems like it
would happen a lot.