ETL rule execution [message #23160] |
Thu, 23 July 2009 06:53  |
Eclipse User |
|
|
|
Hi again,
Just a quick question which I couldn't find an answer to in the Epsilon
book (I might have missed it though):
Does a non-abstract, non-lazy ETL rule only get fired once during a
transformation -- and then the result is cached somewhere? I ask as I was
curious as to whether the following code fragment is bad practice...
var x := sourceComponent.equivalents('ruleX').select(i |
i.isKindOf(SomeClass));
var y := sourceComponent.equivalents('ruleX').select(i |
i.isKindOf(OtherClass));
So, does ruleX get fired 2 times internally, or does its result get stored
somewhere and is just (selectively) retrieved 2 times -- or perhaps I've
just totally missed the target :)?!
I guess this question touches upon some differences between rules and
operations... maybe?
Thanks in advance,
Edd
|
|
|
Re: ETL rule execution [message #23202 is a reply to message #23160] |
Thu, 23 July 2009 11:19  |
Eclipse User |
|
|
|
Hi Edd,
Edward Turner wrote:
> Hi again,
>
> Just a quick question which I couldn't find an answer to in the Epsilon
> book (I might have missed it though):
>
> Does a non-abstract, non-lazy ETL rule only get fired once during a
> transformation -- and then the result is cached somewhere?
That is correct.
I ask as I
> was curious as to whether the following code fragment is bad practice...
>
> var x := sourceComponent.equivalents('ruleX').select(i |
> i.isKindOf(SomeClass));
> var y := sourceComponent.equivalents('ruleX').select(i |
> i.isKindOf(OtherClass));
>
> So, does ruleX get fired 2 times internally, or does its result get
> stored somewhere and is just (selectively) retrieved 2 times -- or
> perhaps I've just totally missed the target :)?!
No. It actually runs only once and the second time you get the cached
results.
>
> I guess this question touches upon some differences between rules and
> operations... maybe?
You can have cached operations as well (i.e. run first time only, then
return cached result) by attaching the @cached annotation. E.g.
@cached
operation foo() {
}
>
> Thanks in advance,
>
> Edd
>
Cheers,
Dimitris
|
|
|
Re: ETL rule execution [message #571011 is a reply to message #23160] |
Thu, 23 July 2009 11:19  |
Eclipse User |
|
|
|
Hi Edd,
Edward Turner wrote:
> Hi again,
>
> Just a quick question which I couldn't find an answer to in the Epsilon
> book (I might have missed it though):
>
> Does a non-abstract, non-lazy ETL rule only get fired once during a
> transformation -- and then the result is cached somewhere?
That is correct.
I ask as I
> was curious as to whether the following code fragment is bad practice...
>
> var x := sourceComponent.equivalents('ruleX').select(i |
> i.isKindOf(SomeClass));
> var y := sourceComponent.equivalents('ruleX').select(i |
> i.isKindOf(OtherClass));
>
> So, does ruleX get fired 2 times internally, or does its result get
> stored somewhere and is just (selectively) retrieved 2 times -- or
> perhaps I've just totally missed the target :)?!
No. It actually runs only once and the second time you get the cached
results.
>
> I guess this question touches upon some differences between rules and
> operations... maybe?
You can have cached operations as well (i.e. run first time only, then
return cached result) by attaching the @cached annotation. E.g.
@cached
operation foo() {
}
>
> Thanks in advance,
>
> Edd
>
Cheers,
Dimitris
|
|
|
Powered by
FUDForum. Page generated in 0.33738 seconds