a C++ question:

From: Damir Buskulic (buskulic@lapp.in2p3.fr)
Date: Fri Sep 04 1998 - 10:22:12 MEST


Hi everyone,

I have a C++ stupid question for specialists.
I have an object, called Frame, that can contain several other objects
of type VSeries. VSeries are time-series. Now I want to Draw a 2D
histogram of the values contained in the two VSeries, one versus the
other. Really a histogram, not the content as a function of time.
If these two series are contained in a Frame object, there is no
problem, I just include a DrawHist(s1,s2) member function to a Frame.
But I can also define series independently of a Frame.In that case, to
draw a 2D hist of these two frames, the simplest solution, and the one
that my friends used to C urge me to use, is to define a global function
Draw(s1,s2) that would do the job and return me a pointer to a TH2F.
But this, as it seems to me, breaks the OO paradigm. And honestly, I
don't have many arguments to explain why I want an object to do the job.
I thought of deriving a special class VH2F out of TH2F and include a
constructor VH2F(s1,s2), and then the user would just do a Draw of this
special 2D hist.
But this forces people to issue two commands, one for building and the
other for drawing. Since this is meant to be in an interactive
environement, well... the simpler, the better.

I rejected the idea of having s1.DrawHist2(s2) as a member function of
VSeries. This is not symetrical and not logical. people would not remind
it.

Does somebody have any idea ? You probably thought about that sort of
things when building the histogram classes Rene, didn't you ?

Thanks very much

Damir
-- 
=====================================================================
| Damir Buskulic                  | Universite de Savoie/LAPP       |
|                                 | Chemin de Bellevue, B.P. 110    |
| Tel : +33 (0)450091600          | F-74941 Annecy-le-Vieux Cedex   |
| e-mail: buskulic@lapp.in2p3.fr  | FRANCE                          |
=====================================================================
mailto:buskulic@lapp.in2p3.fr



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:37 MET