|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ImpactAnalyzer
The Impact Analyzer (IA) analyzes the impact of Notification
s on a single OCLExpression
in the sense that it
determines those context objects of the expression for which the expression's evaluation result may have changed because of the
change indicated by the notification. Imagine this as "spreadsheet" functionality for models: model changes can be propagated
efficiently, even for large to huge models. Possible application areas include OCL constraint re-evaluation after model changes
as well as attribute grammars based on OCL.
The interaction with the IA typically happens in two steps. First call createFilterForExpression()
. This
returns an EventFilter
which can be used to register a listener in the EventManager
. The subscriber will then
be supplied with all relevant Notification
s relevant to the supplied OCLExpression
.
Once a relevant Notification
occurs it can be passed to the IA by calling getContextObjects(Notification)
which returns a set of EObject
s for which the expression's value may have changed due to the change notification. These
context objects can be used to instruct the evaluator to evaluate affected OCLExpressions
for a certain set of
instances.
The impact analyzer has a few configuration options, affecting the choice of implementation. We currently
use those to tune and performance-benchmark variants and flavors of the implementation. If you find that
the default configuration doesn't work well for your case, you may try different configuration options.
See OptimizationActivation
and ActivationOption
for details.
Method Summary | |
---|---|
EventFilter |
createFilterForExpression()
Creates a filter for the given OCL expression, which matches at least all events that cause the expression to change its value on one or more context elements. |
java.util.Collection<org.eclipse.emf.ecore.EObject> |
getContextObjects(org.eclipse.emf.ecore.EObject evaluationResult)
Determines a superset of the set of context objects for which the overall #expression managed by this instance scope analysis results in
evaluationResult or a collection containing
evaluationResult . |
java.util.Collection<org.eclipse.emf.ecore.EObject> |
getContextObjects(org.eclipse.emf.common.notify.Notification event)
For a change notification event calculates a superset of the set of context objects for which expression may have changed its value due to the change indicated by the event. |
Method Detail |
---|
EventFilter createFilterForExpression()
java.util.Collection<org.eclipse.emf.ecore.EObject> getContextObjects(org.eclipse.emf.common.notify.Notification event)
event
- the event to calculate for
null
java.util.Collection<org.eclipse.emf.ecore.EObject> getContextObjects(org.eclipse.emf.ecore.EObject evaluationResult)
#expression
managed by this instance scope analysis results in
evaluationResult
or a collection containing
evaluationResult
. The result is always a valid collection,
never null
, but possibly empty.
evaluationResult
- has to be a non-null
EObject
because
backwards navigation is not easily possible for
primitive-typed values and is impossible from
null
values for now.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |