Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [viatra-dev] Transformation API

OK, I think I get it now.

The other idea I had in mind was to provide an API shorthand for "packaging" several simple (pure Xtend) manipulation operations into a single "command". AFAIK this is the main reason why we want to create "convenience methods" in the first place right? What if we turn the whole thing on its head?

--
Istvan RATH, PhD
Research fellow
Budapest University of Technology and Economics
Fault Tolerant Systems Research Group

On Sunday, September 29, 2013 at 9:53 PM, Ujhelyi Zoltán wrote:

Hi,

the state_Name is the EMF Reflective API literal (Xtend shorthand for *Package.getState_Name() ), while basic is the Object we are setting, so the code is not bogus (at least not in an easily understandable way).

However, this code is not the easiest thing to write manually (at least it was not for me), that's why an alternative like Gábor suggested would be nice (but sadly, I believe is not feasible for single-value features).

Zoli
-- Zoltán Ujhelyi

Fault Tolerant Systems Research Group
Budapest University of Technology and Economics

On 2013.09.29., at 21:49, Istvan Rath <rath@xxxxxxxxxx> wrote:

So the line

basic.set(state_Name, p.name)///name = p.name



Why don't we require to use the EMF reflective API in this case? I.e. by passing the appropriate literal from the EPackage?

--
Istvan RATH, PhD
Research fellow
Budapest University of Technology and Economics
Fault Tolerant Systems Research Group



On Sunday, September 29, 2013 at 9:41 PM, Ujhelyi Zoltán wrote:

The problem is that I cannot find any implementation behind the interface, that works, as the method.name (http://method.name) would return a string without any metainformation, e.g. the corresponding EStructuralFeature. Without knowing the feature (even by knowing the defining object and the Java type) it is not possible to change to original reference.

This issue does not appear in case of lists, as EMF always returns modifiable lists.

Zoli
-- Zoltán Ujhelyi

Fault Tolerant Systems Research Group
Budapest University of Technology and Economics

On 2013.09.29., at 21:36, Istvan Rath <rath@xxxxxxxxxx (mailto:rath@xxxxxxxxxx)> wrote:


Gábor suggested to have convenience methods that handle ELists findable from the EMF API, e.g.:
* method.add(method.parameters, newParameter)

This approach works well for multi-valued references (even better than my EMF-reflective implementation), however, for single-value references or attribute I see no way of implementing an API like this, e.g.:
* method.set(method.name (http://method.name), "main")



What's wrong with this? I don't think it looks awkward.

--
Istvan RATH, PhD
Research fellow
Budapest University of Technology and Economics
Fault Tolerant Systems Research Group

_______________________________________________
viatra-dev mailing list
viatra-dev@xxxxxxxxxxx (mailto:viatra-dev@xxxxxxxxxxx)


_______________________________________________
viatra-dev mailing list
viatra-dev@xxxxxxxxxxx (mailto:viatra-dev@xxxxxxxxxxx)


_______________________________________________
viatra-dev mailing list

_______________________________________________
viatra-dev mailing list


Back to the top