Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-8

Make api.xml.ui SPI a properly pluggable SPI.

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 8.2, 9.0
    • None
    • xml - API, xml - Schema
    • Patch

    Description

      Primary Justification

      According to a common SPI definition, an SPI should be extendable by third parties, and can be used to enable framework extension and replaceable components. A typical example is the Java Service Provider Framework.

      As a public and official API, it is doubtful the spi portion of the XML Tools API UI meets this definition. Because there is no runtime extension loading mechanism provided, it is not really possible for third parties to provide pluggable behaviour for existing clients of the API.

      Motivation

      XML Validation techniques have moved on a long way since the original XML Validation code was written. The SPI seems to imply that the Validation function could be replaced by code in a plugin. Whilst it could be argued that this should probably never have been an SPI, given that it is an official SPI, it should be upgraded to offer true SPI semantics.

      Patch details

      The attached patch adds a factory class to the API to enable clients to create action cookies from third parties. An SPI interface and default registered implementation are also provided for third parties to implement, and to wrap the existing functionality.

      No existing API or SPI has been changed, although some existing javadoc has been updated.

      As part of the patch, org.netbeans.modules.xml.XMLDataObject has been updated to utilise the new functionality. Other clients tend to be very specific and it seems unnecessary to update these. There is a commented out stub (with javadoc) in the API factory class which suggests a mechanism to serve these more specific use cases which can be implemented if this improvement is agreed to have merit.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            rlamont Ross Lamont

            Dates

              Created:
              Updated:

              Slack

                Issue deployment