This project is read-only.

View object graphs & unused types

Jun 8, 2014 at 11:08 PM
What are your thoughts on extending the diagnostic services to display all the registered object graphs? This could also provide feedback on any registered types that are not in any graph.
Jun 9, 2014 at 11:53 AM
That would be an interesting feature.

How do you think Simple Injector should visualize such graph? Should it be graphically visualized, such as with the drawings on Mark Seemann's blog? Or should we do this textually? Or should it be a code representation (with nested constructor calls). Should the graph present class dependencies (where each type is displayed once) or should the graph present a lifestyle tree where singleton and scoped registrations are displayed once, and transient types multiple times? And if done graphically, where do we present this? In the debugger? And dependencies graph tend to get big and complicated with some types referenced by many other types. How do we prevent the graph to become a big ball of wires?
Jun 9, 2014 at 8:17 PM
I would see this as an extension of the ContainerDebugView - currently we have
  • Configuration Warnings
  • Registrations
  • Options
  • Raw View
and each Registration has
  • ImplementationType
  • LifeStyle
  • Relationships
  • ServiceType
  • Raw View
We could have a new items here, something like
  • Injected dependencies (Count = nn)
  • Injected into (Count = nn)
that are populated on expansion.
Jun 23, 2014 at 12:07 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jun 23, 2014 at 12:10 PM
Edited Jun 23, 2014 at 12:13 PM
Unfortunately it's impossible to see which registrations aren't used. It might be possible to detect which registration hasn't been resolved at a certain point in time, but this takes a bit of management to find out, and this information can change every time the program is ran, which might make it less useful.

It is however possible to retrieve all root objects, and it would be useful to have this as a diagnostic feature and as part of the debugger view. For this I created a work item.

This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.