Enhancement #4587

Cleanup URI-related utility classes in the Simantics codebase

Added by Tuukka Lehtonen about 4 years ago. Updated almost 4 years ago.

Status:ClosedStart date:
Priority:4Due date:
Assignee:Tuukka Lehtonen% Done:

100%

Category:-Spent time:-
Target version:1.13.1
Release notes:
Story pointsS
Velocity based estimate-
ReleaseSimantics 1.13.2Release relationshipAuto

Description

The purposes and functionality of the following classes needs clarification and possibly also harmonization:
  • org.simantics.db.common.utils.URIStringUtils
  • org.simantics.graph.utils.URIStringUtils
  • org.simantics.utils.URIUtil
  • org.simantics.graph.query.UriUtils
  • org.simantics.db.common.uri.URIEscape
  • org.simantics.databoard.util.URIUtil
Utilities that are inherently internal to a plug-in should be more clearly made to appear such by:
  • making them more private
  • putting them in .internal packages that are not exported
  • URIEscape is one of these

Think about merging some of them into the org.simantics.utils plug-in.

URIUtil classes are not usable for bijective transformation, only URIStringUtils should be used for those. URIUtil is only useful for escaping file names and such that needn't be unescaped. URIUtil classes are not recommended for DB/Variable URI dependent tasks.

If URIStringUtils is moved into org.simantics.utils, it needs to be deprecated in org.simantics.db.common before removing it.

Associated revisions

Revision 28489
Added by Tuukka Lehtonen about 4 years ago

Made URIEscape package private, no point in sharing this code outside of the package.

refs #4587

Revision 28495
Added by Tuukka Lehtonen about 4 years ago

URIUtil refactoring:
  • Moved TestURIUtil from org.simantics.utils to org.simantics.databoard testcase folder
  • Removed org.simantics.utils.URIUtil in favor of using org.simantics.databoard.util.URIUtil where necessary. Removed all uses of URIUtil from the Simantics trunk codebase.
  • Fixed TrendSupport and ExperimentExportClass to accommodate the URIUtil move.

refs #4587

Revision 28496
Added by Tuukka Lehtonen about 4 years ago

Fixed ChartItemLabelRule to refer to the right URIStringUtils.
refs #4587

Revision 28497
Added by Tuukka Lehtonen about 4 years ago

Moved org.simantics.graph.utils.URIStringUtils to org.simantics.graph.internal to emphasize that this utility should not be used outside the org.simantics.graph plug-in. org.simantics.db.common.utils.URIStringUtils should be used for now.

refs #4587

Revision 28498
Added by Tuukka Lehtonen about 4 years ago

Fixed org.simantics.graph.internal.URIStringUtils according to what has changed in org.simantics.db.common.utils.URIStringUtils.
E.g. escape was broken.

refs #4587

History

#1 Updated by Tuukka Lehtonen about 4 years ago

  • Description updated (diff)
  • Assignee set to Tuukka Lehtonen

#2 Updated by Tuukka Lehtonen about 4 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 50
Did the following changes:
  • URIEscape to package-private
  • Removed org.simantics.utils.URIUtil in favor of org.simantics.databoard.util.URIUtil.
  • Changed all references from outside org.simantics.graph* plug-ins to refer to org.simantics.db.common.utils.URIStringUtils instead of org.simantics.graph.utils.URIStringUtils.
  • Moved org.simantics.graph.utils.URIStringUtils to org.simantics.graph.internal.URIStringUtils, i.e. made it private to org.simantics.graph.

org.simantics.db.common.utils.URIStringUtils has over 150 references to it in my workspace. I don't have to time right now to start moving it around and deprecating things. We just don't need that kind of noise right now.

Right now we are left with these public classes:
  • org.simantics.db.common.utils.URIStringUtils
  • org.simantics.graph.query.UriUtils
  • org.simantics.databoard.util.URIUtil

Hope this helps.

#3 Updated by Tuukka Lehtonen about 4 years ago

  • Status changed from Feedback to Closed

#4 Updated by Tuukka Lehtonen almost 4 years ago

  • % Done changed from 50 to 100

Also available in: Atom PDF