H
hazz
I have a class/constructor hiearchy that functions correctly as illustrated
below (thanks to Ken Kolda's earlier newsgroup assistance.) If a client
instantiates object D, eg. D m_D = new D(str_arg), it climbs up the ctor
stack until B(string str) handles it.
A();
B();
B(string str)
{
do_string_Stuff; }
C();
C(string str) : base(str);
D();
D(string str) : base(str);
Now for the change. I have a class that has this ctor signature.
D ( long n_arg, string str) // :base(str) won't work anymore. will
it have to be :base(n_arg, str)
D m_D = new D(long n_arg2, string str_arg ) would work, just adding an
additional string argument, but I want to get up to the overloaded ctor in
B. How do I change this object design in the least invasive manner? Do I
have to add new constructors with the additional n_arg to C and B for this
to work as per the following?
A();
B();
B(string str)
{ do_string_stuff; }
B (long n_arg, string str)
{ do_string_stuff; }
C();
C(string str) : base(str);
C( long n_arg, string str) : base(n_arg, str);
D();
D(string str) : base(str);
D (long n_arg, string str) : base(n_arg, str);
Thank you very much,
-greg
below (thanks to Ken Kolda's earlier newsgroup assistance.) If a client
instantiates object D, eg. D m_D = new D(str_arg), it climbs up the ctor
stack until B(string str) handles it.
A();
B();
B(string str)
{
do_string_Stuff; }
C();
C(string str) : base(str);
D();
D(string str) : base(str);
Now for the change. I have a class that has this ctor signature.
D ( long n_arg, string str) // :base(str) won't work anymore. will
it have to be :base(n_arg, str)
D m_D = new D(long n_arg2, string str_arg ) would work, just adding an
additional string argument, but I want to get up to the overloaded ctor in
B. How do I change this object design in the least invasive manner? Do I
have to add new constructors with the additional n_arg to C and B for this
to work as per the following?
A();
B();
B(string str)
{ do_string_stuff; }
B (long n_arg, string str)
{ do_string_stuff; }
C();
C(string str) : base(str);
C( long n_arg, string str) : base(n_arg, str);
D();
D(string str) : base(str);
D (long n_arg, string str) : base(n_arg, str);
Thank you very much,
-greg