Question

We are implementing some web services, and need to ensure that some of our methods always return non-null values.

We've investigated two ways of doing this:

Both approaches work, but I'm wondering whether there are any other approaches that we should consider.

How would you enforce non-null return values?


Looks like there was a similar question on SO, and Jon Skeet recommends the Code Contract approach.

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top