| How to use Name Expressions [message #477248] |
Mon, 14 April 2008 12:43  |
Felix Dorner Messages: 675 Registered: July 2009 |
Senior Member |
|
|
Hey,
I am trying to figure out how to work with name expressions. As a simple example, that I already fail to construct, look at the template
Collection<T> { add(T) }. In bound templates, I'd like "add" to change to addA, where A is the name of the actual Parameter in the binding.
So in Collection<Car> I want the add operation to be called addCar().
Is that a correct use case of the name expression mechanism?
Thanks,
Felix
|
|
|
| Re: How to use Name Expressions [message #477254 is a reply to message #477248] |
Tue, 15 April 2008 11:31   |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Felix,
There is a notion of substituting string expressions in the UML spec. but
the UML2 opensource component doesn't support this currently.
To get this to work we would need some facility in the UMLUtil that performs
the "merge" step and substitution of bound parameters to create a new
entity. Right now, we only support exporting UML constructs to an .ecore
representation that can then be used for generically specified code during
code generation.
The last time I looked at this in the spec., the actually string
substitution rules seemed fuzzy (to me at least).
Cheers,
- James.
"Felix Dorner" <felix_do@web.de> wrote in message
news:fu01k8$ufm$1@build.eclipse.org...
> Hey,
>
> I am trying to figure out how to work with name expressions. As a simple
> example, that I already fail to construct, look at the template
> Collection<T> { add(T) }. In bound templates, I'd like "add" to change to
> addA, where A is the name of the actual Parameter in the binding.
> So in Collection<Car> I want the add operation to be called addCar().
>
> Is that a correct use case of the name expression mechanism?
>
> Thanks,
> Felix
|
|
|
| Re: How to use Name Expressions [message #477256 is a reply to message #477254] |
Tue, 15 April 2008 13:57  |
Felix Dorner Messages: 675 Registered: July 2009 |
Senior Member |
|
|
James Bruck wrote:
> Hi Felix,
> There is a notion of substituting string expressions in the UML spec. but
> the UML2 opensource component doesn't support this currently.
That's great, then I have an excuse :-p
> The last time I looked at this in the spec., the actually string
> substitution rules seemed fuzzy (to me at least).
I couldn't really understand either...
Have a nice Day,
I just enjoy a beautiful Spring Day Sunset.
Felix
|
|
|
| Re: How to use Name Expressions [message #626411 is a reply to message #477248] |
Tue, 15 April 2008 11:31  |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Felix,
There is a notion of substituting string expressions in the UML spec. but
the UML2 opensource component doesn't support this currently.
To get this to work we would need some facility in the UMLUtil that performs
the "merge" step and substitution of bound parameters to create a new
entity. Right now, we only support exporting UML constructs to an .ecore
representation that can then be used for generically specified code during
code generation.
The last time I looked at this in the spec., the actually string
substitution rules seemed fuzzy (to me at least).
Cheers,
- James.
"Felix Dorner" <felix_do@web.de> wrote in message
news:fu01k8$ufm$1@build.eclipse.org...
> Hey,
>
> I am trying to figure out how to work with name expressions. As a simple
> example, that I already fail to construct, look at the template
> Collection<T> { add(T) }. In bound templates, I'd like "add" to change to
> addA, where A is the name of the actual Parameter in the binding.
> So in Collection<Car> I want the add operation to be called addCar().
>
> Is that a correct use case of the name expression mechanism?
>
> Thanks,
> Felix
|
|
|
| Re: How to use Name Expressions [message #626413 is a reply to message #477254] |
Tue, 15 April 2008 13:57  |
Felix Dorner Messages: 675 Registered: July 2009 |
Senior Member |
|
|
James Bruck wrote:
> Hi Felix,
> There is a notion of substituting string expressions in the UML spec. but
> the UML2 opensource component doesn't support this currently.
That's great, then I have an excuse :-p
> The last time I looked at this in the spec., the actually string
> substitution rules seemed fuzzy (to me at least).
I couldn't really understand either...
Have a nice Day,
I just enjoy a beautiful Spring Day Sunset.
Felix
|
|
|
Powered by
FUDForum. Page generated in 0.01894 seconds