Exception when service is not available

Feb 24, 2008 at 2:51 PM
Edited Feb 24, 2008 at 2:51 PM
Hi,

after having played with Unity in the last days I'm very excited about it because I missed such a thing in the .NET community while there are several IoC-Containers in the Java world. One I like the most there is HiveMind which is sadly quite inactive today but it seems that Unity's philosophy is in the same tradition as HiveMind.

One question about Unity: I have a dependency within Service-B (it depends on Service-A). When I don't register a Service-A and I try to get Service-B from the container I simply get a null reference back. There is no indication about the real problem, the missing of Service-A. From my experiences with HiveMind it's extremely useful and necessary to have a detailed error information because the net of dependent services can get quite complex. How will Unity address these complexities or better: what is the best way to find the error in a configuration ?

Thank you very much for Unity !

Michael
Feb 25, 2008 at 3:38 AM

sentinel101 wrote:
Hi,

after having played with Unity in the last days I'm very excited about it because I missed such a thing in the .NET community while there are several IoC-Containers in the Java world. One I like the most there is HiveMind which is sadly quite inactive today but it seems that Unity's philosophy is in the same tradition as HiveMind.

One question about Unity: I have a dependency within Service-B (it depends on Service-A). When I don't register a Service-A and I try to get Service-B from the container I simply get a null reference back. There is no indication about the real problem, the missing of Service-A. From my experiences with HiveMind it's extremely useful and necessary to have a detailed error information because the net of dependent services can get quite complex. How will Unity address these complexities or better: what is the best way to find the error in a configuration ?

Thank you very much for Unity !

Michael


The current behavior is a bug; you should be getting an exception, not a null, when a dependency isn't satisfied. Should be fixed soon.