Java Generics

Use this forum for general discussion, feature requests or to report problems.

Java Generics

Postby Guest » Wed Dec 20, 2006 1:00 am

I'm interested in using apollo to model a domain, then commit the model to Java. I'm needing to use java generics, though. How does one make an operation which returns Set<String>, for instance? Once made, how do I view the type on the class diagram?

Re: Java Generics

Postby [gw] Jan Koehnlein » Tue Jan 02, 2007 10:24 am

Note that Apollo currently only supports synchronous roundtrip engineering, that means you cannot create the complete model first and then generate Java from the source.

Unfortunately, the UML2 metamodel does not support generics completely. Especially, you can bind template parameters to types for properties (e.g. attributes of a classifier) but not for parameters of an operation (e.g. the return parameter).

Second, we rely on JDT to do the Java parsing. JDT does not deliver template bindings if you're working on binary classes. You'll get Set instead of Set<String> instead.

For Apollo, we chose a tradeoff. You can parametrise methods and classifiers, but the actual binding, like setting String in Set<String> is not modelled.

To view parameters and their types, you must enable their display in the filter dialog. In the diagram view, click on the filter icon. In the editor, choose Filters->Open filter dialog in the context menu of the diagram.

Jan Köhnlein
Gentleware AG
Jan Koehnlein
[gw] Jan Koehnlein
Posts: 116
Joined: Thu Jul 14, 2005 10:54 am

Are generics planned to be supported ?

Postby tvedtem » Thu Mar 22, 2007 12:37 pm

Without generics support, Apollo's usefulness is severely limited (it really would be an effective tool if it could handle Sets etc.)
Are you planning on addressing this sometime soon ?


Posts: 2
Joined: Thu Mar 22, 2007 11:51 am
Location: London

Postby [gw] Jan Koehnlein » Fri Mar 23, 2007 9:57 am

We are currently working on improving support for generics and multi valued associations. It is planned to incoorporate it in the next release, about end of May.
[gw] Jan Koehnlein
Posts: 116
Joined: Thu Jul 14, 2005 10:54 am

Return to Apollo for Eclipse

Who is online

Users browsing this forum: No registered users and 2 guests