473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Metric design question

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
Jun 27 '08 #1
2 1273
On Tue, 29 Apr 2008 07:00:27 -0700, cbmeeks <cb*****@gmail.comwrote:
[...]
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?
Only you can answer that question. You can do it either way, and which
way is correct depends on your business design goals.

I'm a little confused by the example, as it appears to use properties to
define filtering criteria, which in your previous question seemed to be
something you really wanted to avoid.

But regardless...if you want children instances to respect the parent
values, that's certainly easy enough to implement and would work fine. If
that's how your design needs to work, you can do it. If not, you can do
it the other way. You could even make it configurable per-child (add a
property that tells the child whether to inherit the parent properties or
not).

Pete
Jun 27 '08 #2
On Apr 29, 12:58 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Tue, 29 Apr 2008 07:00:27 -0700, cbmeeks <cbme...@gmail.comwrote:
[...]
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?

Only you can answer that question. You can do it either way, and which
way is correct depends on your business design goals.

I'm a little confused by the example, as it appears to use properties to
define filtering criteria, which in your previous question seemed to be
something you really wanted to avoid.

But regardless...if you want children instances to respect the parent
values, that's certainly easy enough to implement and would work fine. If
that's how your design needs to work, you can do it. If not, you can do
it the other way. You could even make it configurable per-child (add a
property that tells the child whether to inherit the parent properties or
not).

Pete
Yeah, I've decided to use properties. I actually like the syntax now
that I've made some examples. My business framework will hopefully be
a commercial product one day so I am trying to keep flexibility in
mind.

I am hope my "nicheness" will be in that my framework will offer
infinite metric recursion with custom calculations. Uh oh...I just
gave away my secret. lol

Seriously, I like the idea about the "Inherit From Parent" property.
I might look into that as well.

Thanks!
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Miguel Lopez | last post by:
Hello, is there a metric tool for python, which computes measures like cyclomatic complexity number, coupling, cohesion, Halstead,...? Thanks, Miguel Lopez
52
by: piaseckiac | last post by:
I am producing a website on air and need a link to change the entire website from standard to metric for temperature, pressure, miles-kilometers, and volume. Thank you.
23
by: Brian | last post by:
Despite charset being discussed to death, and despite having followed all of those threads, I still have problems. http://www.tsmchughs.com/recipes/soda-bread This page uses iso-8859-1...
7
by: El Camino | last post by:
Howdy all Im trying to do a fairly accurate metric conversion between: inches feet yards Im pretty sure that i have the right number for conversion
8
by: Rainer Queck | last post by:
Hi NG, in a dataset.datatable I have rows, containing metric data as doubles. I need to display/edit these values in textboxes depending on the culture (Metric/Inch). Is there something like a...
3
by: socondc22 | last post by:
Im stuck at this point. The way i was trying to do this was running if statement around my void function and then a else if statement around a different void function but it didnt work... right now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.