Not for this PR and maybe not for this issue/ticket either, but I had another thought about ObjectAdapters, which you might want to mull on.
As you know, we also have the ability to wrap domainObjects, used for testing and for emitting events when calling a method action from another class. One thing we've said we'd like to do (Oscar Bou pushed for this, they do this as a matter of course in their app) is to automatically wrap all domain objects. The wrapper then ensures that the object's invariants are not violated. We had ideas of maybe relaxing this rule for calls from "within" the module (however we define a module), but always enforcing it for inter-module calls. Anyway, it occurs to me that maybe the functionality that's within ObjectAdapter could instead be moved into the wrapper object. As mentioned in another comment on this PR, the ByteBuddy/Javassist creates a subclass and can mix-in other interfaces for the wrapped object to implement - namely WrappingObject. This is currently a marker interface, but it could instead have the responsibilities of ObjectAdapter, eg to obtain the oid and the ObjectSpecification. In other words, the domainObject and the ObjectAdapter would in effect be the same object. (Actually, since WrappingObject is in the applib, probably we would have a further subtype which is visible only to the runtime, eg "WrappingObjectRuntime") This would then mean that wherever today we pass around an ObjectAdapter, instead we would pass around a WrappingObjectRuntime. Anyway, something to mull over. [ Full content available at: https://github.com/apache/isis/pull/121 ] This message was relayed via gitbox.apache.org for [email protected]
