DEV Community

Discussion on: Better Null-Checking in Java

 
redaalaoui profile image
Réda Housni Alaoui

I confirm, the first example works.

But besidd that, this goes against rule of Demeter.

You should not have to access so many indirect attributes to get the zip code. User should expose a getZipCode method.