Use Java 1.8 functional programming features for ContextAnnotation binding to ContextAssertion
Closed this issue · 2 comments
Why
Following the work in #46, the implementation of continuity, combination and extension operators has been generalized.
However, reflection code is harder to maintain. Therefore, an rewrite based on Java Functional Programming capabilities is sought.
What
- implementation of structured annotation operators using functional programming capabilities
- reimplementation of DefaultAnnotationData to hold internal map of type Map<String, ContextAnnotation>, where the String is the class.getName() value of the added ContextAnnotation
- change mechanism in DefaultAnnotationData to perform continuity check, extension and combination operations using the per ContextAnnotation operators.
Notes
@funkydvd I've assigned you for the remainder of the tasks in this issue.
What needs to be done is to revisit the implementation of DefaultAnnotationData.
First, we should update it to include an internal map of String to ContextAnnotation.
The reason is that matching during application of operators from two annotation groups is simplified. Moreover, we have benefits for searching if certain types of annotations are contained in our set.
Second, look at the implementation of operators for each type of ContextAnnotation.
Use them to reimplement the functions allowsAnnotationContinuity
, allowsAnnotationInsertion
, applyCombinationOperator
and applyExtensionOperator
without using reflection.
Thanks!