Bug 474023 - Allow for alternative implementations of Handly model API
Summary: Allow for alternative implementations of Handly model API
Status: RESOLVED FIXED
Alias: None
Product: Handly
Classification: Technology
Component: Core (show other bugs)
Version: 0.4   Edit
Hardware: All All
: P3 enhancement
Target Milestone: 0.5   Edit
Assignee: Vladimir Piskarev CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on: 474001 475149 475446
Blocks:
  Show dependency tree
 
Reported: 2015-07-31 08:01 EDT by Vladimir Piskarev CLA
Modified: 2016-04-15 06:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Piskarev CLA 2015-07-31 08:01:00 EDT
Currently, almost all of the interfaces in o.e.handly.model package are marked with @noimplement, with the single (partial) implementation supplied in o.e.handly.model.impl. However, there might be cases where allowing for alternative client implementations would be really useful. In particular, clients might implement Handly model API on top of existing handle-based models (see bug 473394 for an example of such model adaptation).
Comment 1 Vladimir Piskarev CLA 2015-07-31 09:07:19 EDT
Of course, the reason for the @noimplement constraint is that it facilitates interface evolution: we can define new methods in the interface. If we were to remove this constraint, we would have to come up with some alternative means for interface evolution:

* extension interfaces (quite ugly)
* complete "mini-implementations" of the interfaces that clients should extend (no multiple inheritance, locks clients into the provided class hierarchy)
* default interface methods (seems to be the best solution, but requires Java 8)
Comment 2 Vladimir Piskarev CLA 2015-08-10 03:35:04 EDT
It seems the best we can do without default methods is to provide the "mini-implementations" for all methods of the core handle interfaces in a single class that clients would extend and implement the necessary interfaces as they see fit:

https://github.com/pisv/handly-playground/blob/simpleimpl/org.eclipse.handly/src/org/eclipse/handly/model/impl/simple/ProtoHandle.java
Comment 3 Vladimir Piskarev CLA 2016-04-15 06:22:24 EDT
Effectively fixed via bug 491564.