Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Handly/NewIn07"

(Created page with "__NOTOC__ == New & Noteworthy for Eclipse Handly 0.7 == Almost all of the [https://projects.eclipse.org/projects/technology.handly/releases/0.7/bugs issues] targeted by Ecli...")
 
m
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
== New & Noteworthy for Eclipse Handly 0.7 ==
 
== New & Noteworthy for Eclipse Handly 0.7 ==
  
Almost all of the [https://projects.eclipse.org/projects/technology.handly/releases/0.7/bugs issues] targeted by Eclipse Handly [https://projects.eclipse.org/projects/technology.handly/releases/0.7 0.7] release are concerned with Core API quality. The 0.7 development has been informed in a large part by trying to adopt Handly within the context of a non-trivial existing model implementation (namely, an [https://github.com/pisv/jdt.core-handly experimental fork of Eclipse Java development tools]) to ensure that Handly can deliver a solid foundation without affecting any of the public APIs (and most of the internal APIs) of the existing model.
+
Almost all of the [https://projects.eclipse.org/projects/technology.handly/releases/0.7/bugs issues] targeted by Eclipse Handly [https://projects.eclipse.org/projects/technology.handly/releases/0.7 0.7] release are concerned with Core API quality. The 0.7 development has been informed in a large part by trying to adopt Handly within the context of a non-trivial existing model implementation (namely, an [https://github.com/pisv/jdt.core-handly experimental fork of Eclipse Java development tools]) to ensure that Handly can deliver a solid foundation without affecting any of the public APIs and most of the internal (non-)APIs of the existing model.
  
 
Due to the API rework involved, this release introduces a number of breaking changes. Please see the [[Handly/Migration07|migration guide]] if you are a current adopter.
 
Due to the API rework involved, this release introduces a number of breaking changes. Please see the [[Handly/Migration07|migration guide]] if you are a current adopter.
Line 21: Line 21:
 
==== *ImplSupport Interfaces ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=515667 515667]) ====
 
==== *ImplSupport Interfaces ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=515667 515667]) ====
  
Single inheritance might not be expressive enough to allow the implementor to factor out all the common features shared by elements of a specific model while using skeletal implementation classes provided by Handly. For example, the implementor could factor out the common features of Java elements into the class <tt>JavaElement</tt>, which would extend <tt>Element</tt>. However, the class <tt>CompilationUnit</tt> would then need to extend ''both'' <tt>JavaElement</tt> and <tt>SourceFile</tt>, which is not possible with single inheritance. There are workarounds, such as explicitly duplicating features from <tt>JavaElement</tt> in <tt>CompilationUnit</tt>, or introducing an internal "trait-like" interface with default methods (say, <tt>IJavaElementInternal</tt>) in place of or in addition to the class <tt>JavaElement</tt>. However, our experience with the Java model of Eclipse Java development tools has shown that such workarounds can be quite constraining for the implementor of a real-world, non-trivial model.
+
Sometimes, single inheritance is not expressive enough to allow the implementor to factor out all the common features shared by elements of a specific model while using skeletal implementation classes provided by Handly. For example, the implementor could factor out the common features of Java elements into the class <tt>JavaElement</tt>, which would extend <tt>Element</tt>. However, the class <tt>CompilationUnit</tt> would then need to extend ''both'' <tt>JavaElement</tt> and <tt>SourceFile</tt>, which is not possible with single inheritance. There are workarounds, such as explicitly duplicating features from <tt>JavaElement</tt> in <tt>CompilationUnit</tt>, or introducing an internal "trait-like" interface with default methods (say, <tt>IJavaElementInternal</tt>) in place of or in addition to the class <tt>JavaElement</tt>. However, our experience with the Java model of Eclipse Java development tools has shown that such workarounds can be quite constraining for the implementor of a real-world, non-trivial model.
  
This release attempts to provide skeletal implementations for '''*Impl''' and '''*ImplExtension''' interfaces in a more flexible way by introducing additional "trait-like" '''*ImplSupport''' interfaces with default methods extracted from corresponding skeletal implementations in the <tt>Element</tt> hierarchy. The new approach enables a form of multiple inheritance of behavior. Model implementors may "mix in" '''*ImplSupport''' interfaces directly or extend classes in the <tt>Element</tt> hierarchy, as they see fit. For example, the class <tt>JavaElement</tt> could just extend <tt>Element</tt>, while the class <tt>CompilationUnit</tt> could extend <tt>JavaElement</tt> and implement ("mix in") <tt>ISourceFileImplSupport</tt>.
+
This release attempts to provide skeletal implementations for elements in a more flexible way by introducing additional "trait-like" '''*ImplSupport''' interfaces with default methods extracted from corresponding skeletal implementations in the <tt>Element</tt> hierarchy. The new approach enables a form of multiple inheritance of behavior. Model implementors may "mix in" '''*ImplSupport''' interfaces directly or extend classes in the <tt>Element</tt> hierarchy, as they see fit. For example, the class <tt>JavaElement</tt> could just extend <tt>Element</tt>, while the class <tt>CompilationUnit</tt> could extend <tt>JavaElement</tt> and implement ("mix in") <tt>ISourceFileImplSupport</tt>.
  
 
=== Other API Enhancements ===
 
=== Other API Enhancements ===

Latest revision as of 09:27, 24 June 2017


New & Noteworthy for Eclipse Handly 0.7

Almost all of the issues targeted by Eclipse Handly 0.7 release are concerned with Core API quality. The 0.7 development has been informed in a large part by trying to adopt Handly within the context of a non-trivial existing model implementation (namely, an experimental fork of Eclipse Java development tools) to ensure that Handly can deliver a solid foundation without affecting any of the public APIs and most of the internal (non-)APIs of the existing model.

Due to the API rework involved, this release introduces a number of breaking changes. Please see the migration guide if you are a current adopter.

Here are the highlights of this release.

Introducing *ImplExtension and *ImplSupport Interfaces for Elements

The new design introduced in Handly 0.5 has defined a number of *Impl interfaces which need to be implemented by elements of any Handly-based model. Although it is perfectly fine for elements to implement *Impl interfaces directly, Handly has provided a hierarchy of skeletal implementation classes (rooted in the class Element) that elements can extend to minimize the effort required to implement these interfaces. However, that class-based approach has had a number of limitations, which this release attempts to address by introducing additional *ImplExtension and *ImplSupport interfaces for elements.

*ImplExtension Interfaces (515461)

Besides partially implementing corresponding *Impl interfaces, skeletal implementation classes have effectively defined an "extended" API of their own. A few important auxiliary classes provided by Handly, such as ElementCache, ElementDifferencer, ElementManager, and StructureHelper, have come to depend on some parts of that API. This meant that these auxiliary classes could only work with elements which extended skeletal implementation classes. That was unnecessarily restrictive.

To eliminate this dependency of auxiliary classes on skeletal implementations, this release extracts appropriate parts of the extended API of skeletal implementation classes to the new *ImplExtension interfaces that auxiliary classes and other clients can depend on and that may be implemented by elements directly if the need arises.

*ImplSupport Interfaces (515667)

Sometimes, single inheritance is not expressive enough to allow the implementor to factor out all the common features shared by elements of a specific model while using skeletal implementation classes provided by Handly. For example, the implementor could factor out the common features of Java elements into the class JavaElement, which would extend Element. However, the class CompilationUnit would then need to extend both JavaElement and SourceFile, which is not possible with single inheritance. There are workarounds, such as explicitly duplicating features from JavaElement in CompilationUnit, or introducing an internal "trait-like" interface with default methods (say, IJavaElementInternal) in place of or in addition to the class JavaElement. However, our experience with the Java model of Eclipse Java development tools has shown that such workarounds can be quite constraining for the implementor of a real-world, non-trivial model.

This release attempts to provide skeletal implementations for elements in a more flexible way by introducing additional "trait-like" *ImplSupport interfaces with default methods extracted from corresponding skeletal implementations in the Element hierarchy. The new approach enables a form of multiple inheritance of behavior. Model implementors may "mix in" *ImplSupport interfaces directly or extend classes in the Element hierarchy, as they see fit. For example, the class JavaElement could just extend Element, while the class CompilationUnit could extend JavaElement and implement ("mix in") ISourceFileImplSupport.

Other API Enhancements

  • New API methods have been introduced in ElementDelta and ElementDifferencer to make them more flexible for subclassing (514798, 514848)
  • Element closing API has been revised (515099)
  • Any IElement is now allowed as Element's parent (515232)
  • An earlier API mistake has been fixed by introducing a separate hBuildSourceStructure method that source files now need to implement instead of hBuildStructure (515246)
  • New API methods have been introduced to make equals implementation in elements more flexible (515302, 517614)

Full List of Issues Addressed in This Release

 0.7 - https://projects.eclipse.org/projects/technology.handly/releases/0.7/bugs

Copyright © Eclipse Foundation, Inc. All Rights Reserved.