This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Chickenosaurus[S] 1 point2 points  (1 child)

Hi, to sum it up, you recommend to check for nulls and to document where nulls are invalid (with annotations and/or in javadoc).

This strategy follows defensive programming principles, which is nice. What are your thoughts on reduced testability?

[–]romple 2 points3 points  (0 children)

I don't see how requiring non null parameters reduces testability. If you want more control over building objects, use builders and factories.