How to modify code so that it adheres to the Law of Demeter
- by guazz
public class BigPerformance
{
public decimal Value {get;set;}
}
public class Performance
{
public BigPerformance BigPerf {get; set};
}
public class Category
{
public Performance Perf {get;set; }
}
If I call:
Category cat = new Cateogry();
cat.Perf.BigPerf.Value = 1.0;
I assume this this breaks the LoD?
If so, how do I remedy this if I have a large number of inner class Properties?