Constructor Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am making some abstract classes and I want the user who wants to
implement these classes must implement a parameter less constructor (need
to use Activator to create an Instance just by using parameter less
constructor)

Some ideas will be very help full

Thanks in advance
 
thrax said:
I am making some abstract classes and I want the user who wants to
implement these classes must implement a parameter less constructor (need
to use Activator to create an Instance just by using parameter less
constructor)

Some ideas will be very help full

You can't do that, I'm afraid. There's no way of specifying which
constructors must or must not be present.
 
while you cannot enforce the number of parameters for a constructor, that's
not so bad. If your app provides functionality only for classes that have
implemented a parameterless constructor, then people using your class will
implement a parameterless constructor to get the "business value" of your
class.

Don't sweat it. Trap the error.

--- Nick
 
Back
Top