Uploaded image for project: 'Apache Commons RDF'
  1. Apache Commons RDF
  2. COMMONSRDF-7

Document that RDFTerm, Triple and Quad are immutable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.3.0
    • api

    Description

      From https://github.com/commons-rdf/commons-rdf/issues/57

      ansell:

      As mentioned in #45, should we add a contract requirement that all RDFTerm instances (and Triple?) be implemented as immutable objects?
      https://github.com/commons-rdf/commons-rdf/issues/45

      stain:

      1, if we say SHOULD. But only the exposed RDFTerm+ methods need to be immutable - so this should probably go into each of their descriptions. So if I have a getDatabaseThingie() method that can be mutable.

      ansell:

      The value of stating that the objects must be immutable is decreased if it only applies to the results of the API methods. A useful goal would be to ensure that the entire object is immutable to give a guarantee about threadsafety, but that may be too much for all implementations to support.

      Just stating that the results of the visible API methods are immutable doesn't help much. It is also not likely to apply to the methods that return Optional, as to enable serialisation, the actual field may not be an Optional itself in most cases.

      Attachments

        Issue Links

          Activity

            People

              stain Stian Soiland-Reyes
              soilandreyes Stian Soiland-Reyes (old) (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: