Man, I realize I've been asking a lot of questions lately.
I appreciate you guys helping me in my thought process.
This time, I have a design question I want opinions on.
I'm building a business framework for tracking trending data. I have
a class like:
class Metric
{
public double Value {....property for a calc...}
public DateTime StartDate;
public DateTIme EndDate;
public bool IgnorePeriodDates;
public List<MetricChildMetrics;
}
Now, I can:
Metric m = new Metric;
m.StartDate = "04/01/2008";
m.EndDate = "04/10/2008";
m.Value; // returns all values from StartDate - EndDate
That's not exactly like I have the class but you should get the idea.
You will notice that Value returns a calculation based on the Start/
EndDate. Also, note there is a list of children metrics. The Value
property will return (recursively) all child values. So when you call
a m.Value, you get that metric's values + all children's values.
Now, all child metrics can have their own Start/End dates.
So, if you set "IgnorePeriodDates" to true (default false), you get
back ALL values ignoring the dates and ignoring the children's dates
from the metric down.
Now, if all child metrics had their IgnorePeriodDates set to false
(the default) and you got back the Value of a parent metric (who's
IgnorePeriodDate is true), then all children's IgnorePeriodDate would
be ignored.
Hope this makes sense.....LOL!!
Now, my question:
IF I were to get the value of a child metric who's IgnorePeriodDates
value is false (the default), SHOULD I run UP the tree and see if the
child's parent's IgnorePeriodDate is set to true? In other words,
should children ALWAYS have to respect their parent's properties?
I promise to keep these long-winded questions to a minimum! hahaha
Thanks