LSA Course : Law of Demeter

Hello,

I’m wondering about the law of Demeter and the example in the LSA course :

https://academy.pega.com/topic/data-model-best-practices/v1/in/11776/11826

Is this law only valid if the relationship class does not need any properties? In the linked example, what if we need to keep track of Contestant Scores for each contest, then does the Contestant-Contest class make sense? Or is there another better design?

Kind regards.

@baeyw The Law of Demeter simply says that two paths to navigate to the same object can introduces unnecessary complexity so should be avoided it if possible.

The Law of Demeter is same as saying relationships should be a Directed Acyclic Graphs (DAG) which prohibits closed loops.

@pedel

Thanks a lot, crisp and clear :).

Kind regards