none
Not Implemented exception RRS feed

  • Question

  • Hello guys,

    I guess that you forgot to implement XmlTextWritter.WriteRawAsync method?

    Regards,

    Mario

    Friday, May 6, 2016 2:01 PM

Answers

  • Not that I'm affiliated with Microsoft in any way at all, but "Not implemented" means it is not implemented, which is not necessarily the same as "forgot"!

    This kind of thing can be an unfortunate side-effect of object oriented programming where you have a base class with functions X, Y and Z, with multiple descendent classes that implement them...except that function X doesn't really apply to one descendent class D. Hence D just throws a "Not implemented" exception if you try to call D.X().

    This can often mean that you may not have a very optimal design and have violated the SOLID principles somewhere along the way (the Liskov-substitution principle?)

    It is also worth noting that the MSDN page for XMLTextWriter says:

    Starting with the .NET Framework 2.0, we recommend that you use the System.Xml.XmlWriter class instead.

    So it may just be Microsoft didn't bother fully implementing newer async functionality with old redundant classes!


    Friday, May 6, 2016 2:38 PM
  • Agreed.

    They had overrided .WriteRaw(), that means the sync. write function has been changed and it's logical that the .WriteRawAsync() need to be modified to be functional too.

    Note that .WriteRawAsync() has been added in .NET 4.5. Since they don't recommand people continue to use it, it could be that they've never bothered to add the corresponding implementation for .WriteRawAsync().

    Monday, May 9, 2016 1:31 AM
    Answerer

All replies

  • Not that I'm affiliated with Microsoft in any way at all, but "Not implemented" means it is not implemented, which is not necessarily the same as "forgot"!

    This kind of thing can be an unfortunate side-effect of object oriented programming where you have a base class with functions X, Y and Z, with multiple descendent classes that implement them...except that function X doesn't really apply to one descendent class D. Hence D just throws a "Not implemented" exception if you try to call D.X().

    This can often mean that you may not have a very optimal design and have violated the SOLID principles somewhere along the way (the Liskov-substitution principle?)

    It is also worth noting that the MSDN page for XMLTextWriter says:

    Starting with the .NET Framework 2.0, we recommend that you use the System.Xml.XmlWriter class instead.

    So it may just be Microsoft didn't bother fully implementing newer async functionality with old redundant classes!


    Friday, May 6, 2016 2:38 PM
  • Agreed.

    They had overrided .WriteRaw(), that means the sync. write function has been changed and it's logical that the .WriteRawAsync() need to be modified to be functional too.

    Note that .WriteRawAsync() has been added in .NET 4.5. Since they don't recommand people continue to use it, it could be that they've never bothered to add the corresponding implementation for .WriteRawAsync().

    Monday, May 9, 2016 1:31 AM
    Answerer