It breaks encapsulation, leading to tight coupling.
Directly accessing another object's internals, like a list of items in `ShoppingCart`, violates encapsulation. It tightly couples the `User` and `ShoppingCart`, making changes difficult and error-prone. Instead, the `ShoppingCart` should provide methods to interact with its items safely.
Additional Notes
What design flaw exists if a `User` class directly accesses `ShoppingCart`’s item list?