Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to use Name Expressions
How to use Name Expressions [message #477248] Mon, 14 April 2008 16:43 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
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 15:31 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
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 17:57 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
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 15:31 Go to previous message
james bruck is currently offline james bruckFriend
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 17:57 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
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
Previous Topic:uml2 v2.2.x to v2.1.x backwards-compatible export?
Next Topic:Re: Primitive types
Goto Forum:
  


Current Time: Thu Apr 18 01:07:15 GMT 2024

Powered by FUDForum. Page generated in 0.02003 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top