[flexcoders] Re: Chart Series - formatDataTip inconsistent visibility

2007-02-22 Thread parkerwhirlow
--- In flexcoders@yahoogroups.com, "Ely Greenfield" <[EMAIL PROTECTED]> wrote:
> In this scenario, I would suggest subclassing the Stacked series
> (ColumnSet, or whichever you need), and exposing the percent values.

OK, this seems workable to me.

> i.e., if the behavior is defined, accessible, overridable,
> then it ties our hands in our ability to refactor code and functionality
> because someone might be relying on it. 

I hadn't thought about that aspect. I was considering the usefulness
of having the information, versus needing to protect the class
functionality.

thanks,
PW



RE: [flexcoders] Re: Chart Series - formatDataTip inconsistent visibility

2007-02-22 Thread Ely Greenfield
 
 
In this scenario, I would suggest subclassing the Stacked series
(ColumnSet, or whichever you need), and exposing the percent values.
i.e., add a get function that looks something like:
 
public function
getTotalsValuesBecauseElyWasStupidAndMadeThemProtected():Array
{
  return stackTotals;
}
 
then do the rest of it from external datatip functions.  We'll make the
stackTotals publicly accessible in the next release.
 
Regarding the general question of public/protected/private:  Writing
frameworks is a tricky business. Every public or protected method gets
locked in stone, restricting our ability to innovate with each
release...i.e., if the behavior is defined, accessible, overridable,
then it ties our hands in our ability to refactor code and functionality
because someone might be relying on it. Given that we're trying to do
our best about maintaining compatibility in future releases,   We have
to be very careful about what we make public.  Clearly we have got some
of them wrong (and will continue to), and we want to hear what those are
so we can fix them. But erring to far on the other side...making
everything public...probably would be the wrong answer for everyone.
 
Ely.
 




From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of parkerwhirlow
Sent: Thursday, February 22, 2007 2:35 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Chart Series - formatDataTip inconsistent
visibility



Ely,

Thanks for the info.

The reason I was going with subclasses, is because the Stacked type
series stacking information (stackTotals) is protected, so I needed a
subclass.

This whole thing started with the Stacked type series, the simple
series could possibly be handled in a single case statement. However,
since I have to use a subclass/override dataTipFunction for that, I am
kinda stuck going the subclass route right? Is there some way to do
the chart dataTipFunction and also in some cases use the series
supplied function?

In general, It seems like I find a lot of cases where it seems
completely unnecessary to make a function or variable protected or
private. I mean in the case of formatDataTip, that function does not
modify anything, simply formats a string. That could have been public
even. no danger of calling, and useful for calling or overriding.

If it were public, it would be easy to use the case statement, supply
the default formatDataTip function in the default case, and override
just the ones I wanted to. And if I could have gotten to the stack
totals that would have been just as good or even better.

thanks,
PW

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Ely Greenfield" <[EMAIL PROTECTED]> wrote:
>
> 
> 
> In general, they're prive because we provide an alternate method for
> changing the datatip that doesn't require subclassing (setting the
> dataTipFunction on the chart).
> 
> Depending on the scenario, it feels a little bit like overkill. If I
> were writing this myself, I would write my own dataTipFunction for the
> chart, which just cased on the type of the series generating the
> datatip, and took appropriate action. The only reason I would bother
> with subclassing the series is if I were trying to wrap up new or
> modified series types for use in other apps or by other developers. 
> 
> If you really want to keep the datatip functionality encapsulated in
the
> series...The way datatips work is that the series stuffs a reference
to
> its datatip function into the HitData structure before it returns it
> from the findDataPoints() function. So I would subclass the series,
> override findDataPoints, call the super() version, and then right
before
> returning the hitData structures generated by the super version, stuff
> my own altenrate data tip function into the hitData structures.
> 
> Ely.
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of parkerwhirlow
> Sent: Thursday, February 22, 2007 12:59 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Chart Series - formatDataTip inconsistent
> visibility
> 
> 
> 
> 
> I started making some application specific tweaks to the chart series
> dataTips, and it worked beautifully for ColumnSet (override the
> protected function formatDataTip), but then I soon realized that only
> the SET series (subclasses of StackedSeries) have that function as
> protected. It's actually private on all the standard series.
> 
> Is there a reason that it's private on the normal series, but
> protected on the series sets?
> 
> I am thinking as a workaround, I'll have to

[flexcoders] Re: Chart Series - formatDataTip inconsistent visibility

2007-02-22 Thread parkerwhirlow
Ely,

Thanks for the info.

The reason I was going with subclasses, is because the Stacked type
series stacking information (stackTotals) is protected, so I needed a
subclass.

This whole thing started with the Stacked type series, the simple
series could possibly be handled in a single case statement. However,
since I have to use a subclass/override dataTipFunction for that, I am
kinda stuck going the subclass route right? Is there some way to do
the chart dataTipFunction and also in some cases use the series
supplied function?


In general, It seems like I find a lot of cases where it seems
completely unnecessary to make a function or variable protected or
private. I mean in the case of formatDataTip, that function does not
modify anything, simply formats a string. That could have been public
even. no danger of calling, and useful for calling or overriding.

If it were public, it would be easy to use the case statement, supply
the default formatDataTip function in the default case, and override
just the ones I wanted to. And if I could have gotten to the stack
totals that would have been just as good or even better.

thanks,
PW

--- In flexcoders@yahoogroups.com, "Ely Greenfield" <[EMAIL PROTECTED]> wrote:
>
>  
>  
> In general, they're prive because we provide an alternate method for
> changing the datatip that doesn't require subclassing (setting the
> dataTipFunction on the chart).
>  
> Depending on the scenario, it feels a little bit like overkill. If I
> were writing this myself, I would write my own dataTipFunction for the
> chart, which just cased on the type of the series generating the
> datatip, and took appropriate action. The only reason I would bother
> with subclassing the series is if I were trying to wrap up new or
> modified series types for use in other apps or by other developers.  
>  
> If you really want to keep the datatip functionality encapsulated in the
> series...The way datatips work is that the series stuffs a reference to
> its datatip function into the HitData structure before it returns it
> from the findDataPoints() function.  So I would subclass the series,
> override findDataPoints, call the super() version, and then right before
> returning the hitData structures generated by the super version, stuff
> my own altenrate data tip function into the hitData structures.
>  
> Ely.
>  
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of parkerwhirlow
> Sent: Thursday, February 22, 2007 12:59 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Chart Series - formatDataTip inconsistent
> visibility
> 
> 
> 
> 
> I started making some application specific tweaks to the chart series
> dataTips, and it worked beautifully for ColumnSet (override the
> protected function formatDataTip), but then I soon realized that only
> the SET series (subclasses of StackedSeries) have that function as
> protected. It's actually private on all the standard series.
> 
> Is there a reason that it's private on the normal series, but
> protected on the series sets?
> 
> I am thinking as a workaround, I'll have to do something like this.
> what do you think?
> 
> Use the chart's dataTipFunction, and call back into the series (via
> hitData.element) to a slightly differently named function
> (myFormatDataTip) defined on the series subclass. I don't like this
> because then I have to make sure the myFormatDataTip function exists
> before calling it, and I make assumption about the signature, but I
> think that would work...
> 
> comments?
> thanks,
> PW
>