Wednesday, February 22, 2006

Confusion through documentation

In working with the CEWolf (which I believe stands for: Chart Enabling... um, Wolf) I came across a pretty fundamental question: how do you let the framework know when a chart can be reused vs. when it should be rebuilt?

Conveniently, there is a method that does just that and is located in an extremely logical (and convenient) spot. Now to figure out how to use it... here's the classes javadoc.

1. The method is called "hasExpired" and returns a boolean, which indicates to me that if I return "true": the data "has expired". So, if I want to regenerate I should return true.

2. The javadoc states: "If the data which had already been used for chart rendering is still valid this method should return true". Ok... so, I guess if I want to regenerate I should return false.

3. The javadoc goes on to say: "...there is no guarantee that the dataset production is always avoided if this method returns true". This seems to go along with #2 again: while returning true doesn't guarantee anything, it does mean we'll at least attempt to avoid reproduction: so, if I want to regenerate I should return false.

4. And finally, the javadoc wraps up with: "Returns: true if the data which had been produced with the passed in parameters has expired since its creation, false otherwise". Which seems to basically restate what I was thinking in #1. So, (in my thinking) if I want to regenerate I should return true.

Well, I guess that since #1 and #4 are based on my interpretations while #2 and #3 are blatently telling me that my interpretation is wrong, I am going to start with returning false when I want to regenerate... but I don't like it. and even if return false does regenerate: I'm going to have to test to make sure that's right. Kinda stinks.

1 Comments:

At 7:47 AM, Blogger Pratik Parikh said...

So can you update and tell us; what did work for you?

 

Post a Comment

<< Home