Roundtip engineering / Dependencies do not show up

Roundtip engineering / Dependencies do not show up

Postby Pate_0816 » Tue 2 Oct 2018 15:27

Hello all

I am currently evaluating a bunch of UML tools for my team and myself, so I came across bouml.
Nevertheless, I am facing a few problems, which might be related to my poor understanding of this application. Maybe someone is able to answer my questions:

Objective:
I want to import an existing project into bouml and have a look at the UML diagram. Afterwards, I want to do the following steps frequently:
- Add/delete some classes
- Generate c++ code
- Extend the generated c++ code with my external IDE
- Update the UML diagram in bouml

What I tried:
- Create a project "test"
- Languages -> c++ selected
- Right click on the project, reverse -> c++ (directories)
- Create a class view
- Create a class diagram
- Drag and drop some classes into the class view (bouml connects the classes automatically and in a very nice way, if their relationships are a composition, an aggregation, etc. But all relationships of the type "dependency" will not be displayed... Why does bouml not show a dashed arrow for this relationship after importing an existing project?)
-> Now, I have got my UML diagram. (But without the dependency arrow...)

Now, I want to add a new class and generate c++ code:
- Add class (With default declaration)
- Add artifact (With default definition)
- Associate artifact with the new class
- Generate -> c++
-> Now, I have got my desired c++ code.

If I edit my existing source code with an external tool, like an editor or an IDE, I do not know, how I should import my source code into my existing bouml project. Here is what I tried:
- Rightclick on project -> Reverse -> c++ (Directories)
- Now, I have two folders with the simliar source code. I delete the older one.
-> This results in my desired UML diagram, but I am sure, this is not the right way to do this...

Could somebody please provide a step-by-step solution? I would really appreciate your support.
Pate_0816
 
Posts: 2
Joined: Tue 2 Oct 2018 12:53

Re: Roundtip engineering / Dependencies do not show up

Postby Bruno Pagès » Tue 2 Oct 2018 15:49

Hello,
Pate_0816 wrote:...
What I tried:
- Create a project "test"
- Languages -> c++ selected
- Right click on the project, reverse -> c++ (directories)
- Create a class view
- Create a class diagram
- Drag and drop some classes into the class view (bouml connects the classes automatically and in a very nice way, if their relationships are a composition, an aggregation, etc. But all relationships of the type "dependency" will not be displayed... Why does bouml not show a dashed arrow for this relationship after importing an existing project?)
-> Now, I have got my UML diagram. (But without the dependency arrow...)


To be displayed a dependency must exist, like for any other relation between classes (expect for the "nested" relation of course)
But the reverse/roundtrip creates dependencies only to support friend class indications and for some typedef forms

Which relationships did you expect to see through dependencies ?

Pate_0816 wrote:Now, I want to add a new class and generate c++ code:
...
If I edit my existing source code with an external tool, like an editor or an IDE, I do not know, how I should import my source code into my existing bouml project. Here is what I tried:
- Rightclick on project -> Reverse -> c++ (Directories)
- Now, I have two folders with the simliar source code.

That time you want to update your model and the roundtrip was the right tool, not the reverse.

The reverse creates classes etc without condition, it doesn't look what already exist or not in the model. This is why you can start the reverse from any packages. This is also why you have again the reversed folder (in fact a new version of it with the changes you did)

The roundtrip updates the current model or a part of it, adding and/or deleting (after your acknowledge) and/or modifying classes and other elements. This is why you cannot start the roundtrip from a new package for instance, because that package is not associated to a directory in your file system.

Please refer to the documentation for more details

Pate_0816 wrote:- Now, I have two folders with the simliar source code. I delete the older one.

When you delete the older one all the deleted classes etc are removed from the existing diagrams whose are not under the deleted package (the diagrams under the deleted package are also deleted of course, not only some elements into)
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 600
Joined: Mon 20 Feb 2012 09:23
Location: France

Re: Roundtip engineering / Dependencies do not show up

Postby Pate_0816 » Wed 3 Oct 2018 12:58

Thanks for the very fast answer, I tried the roundtrip action and it works like a charm :D

Nevertheless, I am still facing the issue with the lacking dependency. Let me explain further, what I expected and what my source code looks like.

Source code:
Code: Select all
class Die { public void Roll() { ... } }
class Player
{
public void TakeTurn(Die die) { die.Roll(); ... }
}


I copied this class into my source folder and executed a roundtrip. Then I dragged the Player class and the Die class into the class diagram. I expected, that these classes will be connected automatically with a dependency arrow, (A dotted line with an arrow from Player to Die) but this was not the case.

If I draw the dependency line by myself in the class diagram, I expected that the following generated source code will change, but it remained the same.

Are you able to follow my description? Or do you need further informations? I really appreciate your support.
Pate_0816
 
Posts: 2
Joined: Tue 2 Oct 2018 12:53

Re: Roundtip engineering / Dependencies do not show up

Postby Bruno Pagès » Wed 3 Oct 2018 14:15

Pate_0816 wrote:
Code: Select all
class Die { public void Roll() { ... } }
class Player
{
public void TakeTurn(Die die) { die.Roll(); ... }
}


I copied this class into my source folder and executed a roundtrip. Then I dragged the Player class and the Die class into the class diagram. I expected, that these classes will be connected automatically with a dependency arrow, (A dotted line with an arrow from Player to Die) but this was not the case.

If I create dependencies from each class to the classes used to type the parameter/value of its operation or referenced in its body the result will be a huge noodle dish :shock:

Note that I do not parse the body of the operation to search for used (mothers) classes.

Pate_0816 wrote:If I draw the dependency line by myself in the class diagram, I expected that the following generated source code will change, but it remained the same.

What change did you expect in the generated code ?
Supposing you have the classes A and B and you add a dependency from A to B, what must change in the code generated for A ? Do you expect BoUML also create a new operation (what name and profile ?) and/or change the type of one (randomly) or all parameter(s)/return of one (randomly) or all the existing operations ?
On the reverse if you have a dependency between Player and Die, then you delete that dependency, BoUML has to modify TakeTurn to remove the type of the parameter and may be change the body ?
it does not make sense to me :?

Anyway in BoUML the dependencies are used and have consequences on the generated code depending on the target language, for Java between artifacts they allow to generate forms "import", please search for "dependenc" in https://www.bouml.fr/doc/index_javagenerator.html
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 600
Joined: Mon 20 Feb 2012 09:23
Location: France


Return to Examples - How to do / Exemples - Comment faire

Who is online

Users browsing this forum: No registered users and 1 guest

cron