Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Parameterized class as an operation parameter type
Parameterized class as an operation parameter type [message #1061870] Tue, 04 June 2013 12:54 Go to next message
Hans Dampf is currently offline Hans DampfFriend
Messages: 2
Registered: June 2013
Junior Member
Hi,
I'm currently working on a UML class diagram to model a typical business application (sort of a customer relationship management system).

Thus I need to define a template's operation with a parameter, whose type is a parameterized interface (List<E>, where E is the templates parameter). To clarify my class structure:
class List<class T>

interface JpaRepository<class E>
    List<E> findAll()
    void delete(E element)
    etc...


I know how to define the delete function in this case, I can apply E as a parameter. But I don't know how to define the findAll() operation, as I have not yet found a way to use parameterized classes as operation parameter types in Papyrus. I have heard, that UML provides parameterized classes, but is it possible to use them with Papyrus? I do not want to create a new template bound class for each usage of List<T>!

Greetings,
Martin Puffe

[Updated on: Tue, 04 June 2013 13:49]

Report message to a moderator

Re: Parameterized class as an operation parameter type [message #1061897 is a reply to message #1061870] Tue, 04 June 2013 15:00 Go to previous messageGo to next message
Arnaud Cuccuru is currently offline Arnaud CuccuruFriend
Messages: 34
Registered: April 2010
Member
Hi Martin,

I am not sure to see what you mean by "parameterized classes" in the context of UML. Do you have a pointer in the UML spec or somewhere else?

For your example, I am affraid that the return type of the operation findAll has to be defined using TemplateBindings relationship.

If List<E> is used multiple times in your interface JpaRepository, you can for example define it ONCE as a nested classifier of this interface (with appropriate template binding relationships), and reuse it for typing parameters of JpaRepository operations.

Cheers,

Arnaud
Re: Parameterized class as an operation parameter type [message #1062006 is a reply to message #1061897] Wed, 05 June 2013 11:41 Go to previous message
Hans Dampf is currently offline Hans DampfFriend
Messages: 2
Registered: June 2013
Junior Member
In the context of UML I mean a template, but the parameter needs to be specified (E).
How can I bind a nedsted class to the template using Papyrus? I haven't found a way yet, since there's no place to drop the TemplateBinding edge?

Edit: Using the nested calssifier compartment I have found a way to apply a template binding on a nested class. But I cannot use the template parameter of the class, which holds my nested class to substitute the List formal template parameter with an actual parameter. What am I doing wrong?

[Updated on: Wed, 05 June 2013 11:52]

Report message to a moderator

Previous Topic:Update sites for Papyrus nightly builds
Next Topic:Generating UML Class Diagram from .uml
Goto Forum:
  


Current Time: Thu Apr 25 00:01:07 GMT 2024

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

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

Back to the top