Write roundtrip plugout

Please use this forum for open discussions about Bouml.
Merci d'utiliser ce forum pour des discussions ouvertes à propos de Bouml.

Write roundtrip plugout

Postby duncan » Wed 25 Apr 2018 11:42

Dear Bruno,

I am new to Bouml. Thank you for writing and maintaining it. It seems like a great, great tool. I am considering using Bouml in an unusual way. The powerful plug-out architecture and rich c++ API it offers suggest it may be the right tool for me.

I have a pre-existing API described in YAML files. This API is used to generate code across lots of languages (c++, java, .net, swift etc). I have my own tooling to perform the code generation. These YAML files live in a git repository, are edited by multiple users, contain documentation, lots of in-house tags to control the generation etc. They provide a "single source of truth"--they describe the API.

I have c++ tools to read these YAML files, build an in-memory model of the API, perform some manipulation/validation on it and write YAML back out. But I would like to provide a user-interface for editing this API and for producing class diagrams for selected areas of functionality offered by the API.

I'm really excited about what Bouml offers, and am keen to try things out, but I have many questions. I'd like to start by ascertaining if Bouml can do what I'd like.

Can a roundtrip plugout do what I need? Could I write a roundtrip plugout populate a Bouml project from my YAML files, and write any changes made within Bouml back to those YAML files so that Bouml becomes a graphical user-interface that sits on top of my existing (YAML) representation of my API?

Is the source code for the C++ round trip plugout (or any roundtrip plug-out) open source? I don't know where to start. I've successfully built my first plug-out following http://www.bouml.fr/tutorial/tutorial_plugout.html but I'm looking for further help.

How do diagrams reference classes? Consider the following workflow:
1. I build a class diagram in Bouml that contains a class. Let's call it "ClassA".
2. I save the project and close Bouml.
3. A user modifies the contents of "ClassA" (but not it's name) in the YAML file. Let's say they add a new operation "operationA".
4. I reopen Bouml and view the diagram I created in (1).

Will "operationA" appear in my diagram (assuming I have written my plugout correctly)?

If a user renames "ClassA" to "ClassB" in my YAML files, is there any way to keep the class in the Bouml diagram? Are classes referenced by their name or by some id (which I could store in my YAML)?

I think that's enough questions for a first posting!

Thanks again,

Duncan
duncan
 
Posts: 1
Joined: Tue 24 Apr 2018 20:34

Re: Write roundtrip plugout

Postby Bruno Pagès » Wed 25 Apr 2018 13:14

Dear Ducan,
duncan wrote:Can a roundtrip plugout do what I need? Could I write a roundtrip plugout populate a Bouml project from my YAML files, and write any changes made within Bouml back to those YAML files so that Bouml becomes a graphical user-interface that sits on top of my existing (YAML) representation of my API?

Any plug-out access to the model in read and write, so yes you can write a roundtrip by yourself.

Let's note that the XMI2 import is a standard plug-out, I mean not a plug-out written by hand like the C++/Java/... generator/reverse/roundtrip

Anyway you cannot access into a class diagram through the plug-out API, I mean as a picture, so you cannot know what is drawn into, how, nor to add/remove/modify elements in it. This is why I do not manage UML Diagram Interchange. There is just few exception concerning the sequence/use case/collaboration diagrams to be able for instance to generate the XMI definition of the interactions, but this is only a read access, you cannot these diagram as the picture point of view through a plug-out

duncan wrote:Is the source code for the C++ round trip plugout (or any roundtrip plug-out) open source? I don't know where to start. I've successfully built my first plug-out following http://www.bouml.fr/tutorial/tutorial_plugout.html but I'm looking for further help.

No, the manual plug-outs are not anymore open source

The "XMI2 import" is a kind of reverse, and only a reverse, a roundtrip is more complicated to do.

The state machine generator also modify the model, it has a roundtrip part if I can say because it not only create but also modify, but its scope is very specific

duncan wrote:How do diagrams reference classes? Consider the following workflow:
1. I build a class diagram in Bouml that contains a class. Let's call it "ClassA".
2. I save the project and close Bouml.
3. A user modifies the contents of "ClassA" (but not it's name) in the YAML file. Let's say they add a new operation "operationA".
4. I reopen Bouml and view the diagram I created in (1).

Will "operationA" appear in my diagram (assuming I have written my plugout correctly)?

You will see the new operationA in the class diagrams where classA is drawn supposing of course the drawing option "hide operations" is not set and you haven't specified the operations to show (individual operation visibility). By default the operations and attributes are shown in the class diagrams, but not their full definition

duncan wrote:If a user renames "ClassA" to "ClassB" in my YAML files, is there any way to keep the class in the Bouml diagram? Are classes referenced by their name or by some id (which I could store in my YAML)?

The classes like other objects are referenced by their id, the name is not relevant, and some objects can have no name.

In the plug-out API this id is returned by the operation getIdentifier() defined on UmlBaseItem which is a class inherited indirectly by all the classes associated to an element into the browser in Bouml

Kind regards,

Bruno
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 636
Joined: Mon 20 Feb 2012 09:23
Location: France


Return to Open discussions / Discussions ouvertes

Who is online

Users browsing this forum: No registered users and 1 guest

cron