I’m trying to understand a large project that makes heavy use of StructureMap (an IOC/DI container framework). The interfaces of all shared components are contained in a single project that is referenced by all other projects.
Trying to build the dependency hierarchy, I found that it is extremely difficult to detect which project is dependent on what others, since there are no direct project references, only a single reference to the interface project.
How can I still build the hierarchy tree? Conversely, is concentrating all interfaces in a single super-project good practice, or should it rather be “normal”, i.e. every project contains its own public interfaces (as well as the predefined concrete classes that implement it). That would also allow to easily construct the hierarchy by simply following the references projects.
This may be a bit subjective, but I would advocate against this packaging of interfaces in a separate project containing interfaces that aren’t naturally related to each other. If you have separate projects for different parts of your application, the interfaces for those projects should also be separate. While there may sometimes be reason to put the interfaces in a separate project from the implementation, there’s not likely a good reason to combine interfaces from multiple implementation projects into a single giant interface project as you’ve described.
If you’re stuck with this situation, and want to reveal the real runtime dependencies, you’ll likely need to inspect the configuration, which may be possible using the registry DSL, or may require parsing XML configuration.