Can Javers be used to calculate the differences using class/object like metamodels instead of concrete Java classes?
My research so far leads me to believe Javers differences only works on models which are realized as concrete Java classes.
Similarly with the java-object-diff library.
I have a metamodel in which a single model contains roughly similar information to what one gets using the Java Reflection APIs (i.e. Class, Field). I also have model object instances, which are similar to a Java Object (i.e. an instance of a class). Both the metamodel and model object instances are Java classes, but the classes themselves are general reused modeling classes and uninteresting themselves.
I'm expecting to have to do quite a bit of wiring to expose the details of the metamodel to the differencing algorithm, equivalent to what one gets from the Java Reflection API and the usual Java object semantics. Such as:
- What is an entity?
- What are an entities attributes?
- What is the cardinality of an attribute? (e.g. one, many/collection/list/array).
- What type is the attribute value, entity or non-entity (e.g. primitive). Is the attribute another entity or a non-entity (e.g. primitive)?
- Provide a means to read the value of an attribute given an entity instance.
- What is the definition of "identical"?
- What is the definition of "equal"?
- What is the definition of "comparable"?
- Support complex correlation (e.g. a similarity metric) when differencing sets/collections, not just by standard "equality".
etc.