2

I am working on an extension in Jena, where I have to add new Update element similar to UpdateModify but the logic is different and I do not want to extend UpdateModify. The UpdateVisitor interface does not have a visit method for the new element. What would be a suitable way to proceed in this case? Create an interface which extends UpdateVisitor, add my new element's visitor method, in that case I have to rewrite all the other update instances which implements this newly extended interface. Is this a good way to implement this?

Adrika
  • 51
  • 2
  • If you can't subclass `UpdateModify` then you can change `UpdateVisitor` to add your new Update element. (It is a feature of the visitor pattern in general that the visitor interface is closed.) – AndyS Nov 16 '20 at 11:30

0 Answers0