I am working with Java reasoning library (OWL-API) built on an architectural style from the 90s: a large number of interfaces and the visitor pattern. Many objects created seem in large part not to have equals
or hash
implemented. And of course they don’t have case classes.
Implementing the Visitor pattern looks to be very tedious as one can see by looking at the OWLLogicalAxiomVisitor for example.
The library is the result of a decades of work on logic and complexity coming from Academia in the field of Description Logics, then standardised at W3C from 2000 onwards. So re-implementing this library is not an option to be considered lightly. To get an idea of the task involved in rewriting: the OWLOntologyManager when pointed at the Financial Industry Business Objects (FIBO) standard, downloads 130 documents that make up about 100 thousand statements, that are transformed into innumerable Axiom objects (eg OWLSubClassOfAxiom).Instead some way of wrapping the many objects created by the framework could be a way to go to make life easier for a scala dev. I could just wrap them somehow in case classes that implement the same interfaces to get the equals, hash and constructors for free, but this is going to end up leading to a lot of tedious code…
Is this the place to use Dotty Macros? Or is there some other feature that could come in useful? I just thought I’d fish for some ideas. There is so much new in Dotty it is easy to miss some easy answer.
In the mean time I’ll get to see how the library works by implementing things the traditional way by extending interfaces. Perhaps doing that will give me some ideas…