John,

>You missed his point.

Then, exactly, what is his point?

>So break the init into critical and non-critical, with the 
>non-critical being virtal.

That won't do the trick though. Calling the virtual method from the
constructor is not reliable. That's why FxCorp issues a warning. The method
call being critical or non-critical to construction does not matter here.

I think, as a rule, it's best not to call virtual methods from constructors.
Hence, the FxCorp rule. If you disagree, please let me know why... Maybe it
is me missing the point.

Furthermore, if you want initialization to be customizable, you should
introduce some idiom for it. Perhaps a Initialize method this is *not*
called from the constructor. (This leaves it up to the client to call
it---and I can tell why you're not happy with that, but the life of a
programmer is not always a walk in park, you know... Just think of it as the
construction/initialization complement of Dispose. Maybe you should define
an IDispoable-like interface for it: IInitializable or something...)

Cheers,

Stefan

Reply via email to