views:

103

answers:

1

I have a couple of objects in Spring.NET that I have created in the request scope. This works fine when the instance exists but sometimes they need to be null. If I return null from the factory that creates them I get an error from Spring.NET indicating that it cannot wrap a null object. I gather it is trying to create a proxy around the object and failing to do so since it is null.

How do I get Spring.NET to accept a null from a factory method?

A: 

I dont know how to get Spring.NET to accept a null from a factory method but maybe you can make use of the NullObject Pattern in your factory method, so that your factory returns an Object which does nothing instead of a null reference.

tobsen