|
|
|
| Re: How to specialize the aggregation for code-generation [message #521214 is a reply to message #520867] |
Tue, 16 March 2010 14:25   |
Konstantin Messages: 8 Registered: March 2010 Location: Germany |
Junior Member |
|
|
Thanks to all for quick answer.
I'm trying the TopCased.
It's not so easy to generate a source code from Model there. I'm not ready with this yet.
My problem is, that I've used parts of UML 1.x before and I'm able to read models (I guess), but I never could generate a suitable source code from the model. That is something I'd like to learn.
Most of the free-ware tools I've worked with were not good/flexible/comfortable enough. And I was not ready to pay for something I cannot use efficiently.
So I want to try UML for MDD with free-ware tools again and the TopCased appears to be the right choice.
[Updated on: Tue, 16 March 2010 14:26] Report message to a moderator
|
|
|
|
|
|
| Re: How to specialize the aggregation for code-generation [message #522933 is a reply to message #522897] |
Wed, 24 March 2010 10:57   |
Rafael Chaves Messages: 144 Registered: July 2009 |
Senior Member |
|
|
Konstantin, unless the code generation tools you use require you to use UML templates to generate Java code with generics, I would stay away from it. UML templates are a much more powerful concept than Java generics, and are intended for different purposes.
If all you want to do is to be able to use Java generics in multivalued relationships (with collections), using UML templates is using a cannon ball to kill a fly (no to mention it smells like bringing implementation concerns to your models).
Generating Java code with generics in collection elements really does not require any information you don't have already in a regular property element.
Cheers,
Rafael
[Updated on: Wed, 24 March 2010 10:58] Report message to a moderator
|
|
|
| Re: How to specialize the aggregation for code-generation [message #522946 is a reply to message #522897] |
Wed, 24 March 2010 11:10  |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Konstantin
I'm not sure what tool you are using to go from Java to UML but it sounds
like it's missing the generics part.
The simplest way to start is with an Ecore model. Define all your generics
in Ecore; make sure you can generate the kind of Java code you want. You
can then convert from Ecore to UML if you want to get the UML representation
(by using the Ecore to UML converter provided by the UML2 project ).
I totally agree that UML is very tricky and verbose.
Ecore is more compact and more intuitive if you are using it to generate
code.
Cheers,
- James.
"Konstantin" <tkachenkok@gmx.de> wrote in message
news:hod0hi$iq$1@build.eclipse.org...
> Hi James,
>
> Thanks for advice.
> I've looked at this article before writing the post. I haven't got all of
> the things there. :blush:
> I'm not sure, why is the concept of generics so complex in UML. I'm new to
> profiling. ECore is an UML profile. But what is advantage of using it?
> Should I use it? How can I use it? ...
> So I've decided to learn by doing.
> But the attempt was not successfull.
>
> I've made simple Java project with two classes:
>
> public class SudokuField { private List<LineConstraints> lineConstraints;
> SudokuField() { ... }
> public static void main(String[] args) { ... }
> }
>
> public class LineConstraints {
> public static void main(String[] args) { ... }
> public void SayHallo() { ...}
> }
>
> And then I've converted it to the uml model (Using UML from Java). But the
> result of it disappointed me:
>
> <Class> SudokuField
> <Property> lineConstraints : List
>
>
> The information about the generics was not there... :(
>
> So I have something to learn about, before I'm ready to use such a
> tools...
>
> I think, I'll start with the exploring the ECore...
|
|
|
|
Powered by
FUDForum. Page generated in 0.05527 seconds