The view is A? Then the view is trying to access the C, isnt that a violation?
And if street_name was an object of another class then will user be violating the law?
Unless you delegate it somehow, it is violating. The view can know that the user has an address, it should not know how many layers are between the user and itâs address.
If street_name was an object, youâd probably have to call a method on it, like:
address.street_name.name
In this example the user would be violating the law of demeter, it should know that the address has a street_name, bu should not care where it comes from.