Clean up CreationEvent hierarchy
berezovskyi opened this issue · comments
Andrew Berezovskyi commented
IIRC, in Lyo 2.2.0 we removed the abstract
modifier from the ChangeEvent
class due to shortcomings in the JenaModelHelper
at the time.
I have 3 thoughts:
- We should make it abstract again.
- We should create a superclass over
Creation
andModification
events, for example, aCreationOrModificationEvent
. The reason for this is that the TRS 3.0 spec changes the semantics to strip Creation and Modification events of any semantically meaningful distinction. The reason is that many apps in the field violate the existing semantics and we shall codify it. I was against it but it got into the spec text anyway. This way, app developers would be able to check if a resource is an instance ofCreationOrModificationEvent
, which is in line with the spec text (i.e., you cannot check further for the instance of aCreation
event because it may a modification labelled as a creation or vice versa). - Make use of the JDK 17 sealed feature and seal both the
ChangeEvent
class and theCreationOrModificationEvent
.
Andrew Berezovskyi commented
As I was experimenting with dynamic proxies in Java that only support interfaces, we also need to extract an interface from each of these classes as well (and bring along the annotations).
Andrew Berezovskyi commented
Breaking because some apps may now depend on the non-abstract nature of the ChangeEvent
.