[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: [QVTO] How to cast and do a return?

Hi Radek,
Ok thank you. Yes I can restructure the mapping. But you mentioned that
mappings normally should return something. Maybe it would be better in
my case that I refactor my mapping into a helper? I fear that I can read
about the exact intention of mapping and helper in the QVT spec from the
OMG :(

best regards,
Gilbert

radek dvorak wrote:
> Hi Gilbert,
> 
> Using 'return' from mapping operations is limitation of the current QVTO
> release.
> The reason is that a mapping typically has a return type and consequently
> a predefined 'result' variable, which receives its final value within or
> just
> in the end of 'init' section.
> It might be a bit confusing if a mapping returned (via explicit return
> expression)
> a value different from the one already recorded in traces.
> 
> The OMG spec is not clear about this situation so we imposed this
> limitation,
> thinking it can always be solved in an alternative way.
> 
> In your mapping we actually could allow explicit return as there is no
> result
> variable involved.
> 
> However, for now, I assume you can just restructure your mapping to
> avoid the need for
> return expression.
> 
> We also have to rethink some other cases to make things more flexible.
> 
> Regards,
> /Radek
> 
> 
>