If you're talking about Law of Demeter as in, "don't call the neighbors of neighbors" you can delegate it to other methods that do what you want.
From your example I'm guessing you want to reset the performance value or something. You can modify the example code so they are chained inherently instead:
Category cat = new Category();
cat.resetPerf();
The code would be something akin to this:
public class BigPerformance
{
//constructors 'n stuff
public static decimal DEFAULT;
public decimal Value {get; private set;}
public void reset() {
Value = BigPerformance.DEFAULT;
}
}
public class Performance
{
//constructors 'n stuff
private BigPerformance BigPerf {get; set};
public reset() {
BigPerf.reset();
}
}
public class Category
{
// constructors 'n stuff
public Performance Perf {get; private set;}
public resetPerformance() {
Perf.reset();
}
}
That way the Category
class doesn't need to know how to reset the value in case the default value is something different or it's type is changed in the future.
Personally if the risk for change is low I'd go for juharr's answer instead.