How to generate code by Papyrus on Eclipse?

前端 未结 7 2208
野的像风
野的像风 2021-02-03 12:38

I install Papyrus at here. So how to generate code using Papyrus ?

相关标签:
7条回答
  • 2021-02-03 12:58

    It doesn't work with Java because even if you get a code from a class diagram then this code is so dirty that it is totally unusable.

    It seems that this tool has been written by modelers who have never done any java codding :-)

    0 讨论(0)
  • 2021-02-03 13:05

    To generate code from a UML diagram created with Papyrus must create a run configuration for Papyrus.

    More information and a demo video at the following links.

    • http://www.papyrusuml.org/scripts/home/publigen/content/templates/show.asp?P=140&L=EN
    • http://www.papyrusuml.org/home/liblocal/docs/Documentation/Java-Code-Gen/Papyrus-GenJava-GenerateCode.swf
    0 讨论(0)
  • 2021-02-03 13:12

    To generate the java code from UML you can follow the below steps.

    1. New Project->EMF Project Press Next
    2. give the project name
    3. In Model Importer page select UML model and press Next
    4. Select UML model which is created by using Papyrus.Press next
    5. In Package selection page select all the root packages
    6. click finish, it will generate genmodel.
    7. Use the genmodel to generate Java code.

    I hope this information helps.

    0 讨论(0)
  • 2021-02-03 13:14

    These can help you.

    Papyrus Tutorials

    0 讨论(0)
  • 2021-02-03 13:15

    Papyrus is an Eclipse lugin for modeling, you need to use additional Eclipse plugin to do model transformations. In the other answer you can find link to tutorials. First of them indicates you should use QVTo.

    Resources:

    • http://wiki.eclipse.org/M2M/Operational_QVT_Language_%28QVTO%29
    • http://www.eclipse.org/m2m/qvto/doc
    • http://www.eclipse.org/modeling/m2m/downloads/index.php?project=qvtoml
    0 讨论(0)
  • 2021-02-03 13:17

    In order to generate any text artifacts from UML models in the Eclipse Modelling Environment (i.e. Papyrus, TopCased, etc.) you should use Acceleo which is an eclipse implementation of the MOF models to text transformation language, the OMG standard language for models to text transformations. It is a very well made technology but it could take some time to become familiar with it especially if you do not know MOF and the Model Driven Architecture.

    QVT is another OMG language but its aim is models to models transformations (not models to text). It is therefore not the right answer to your question.

    0 讨论(0)
提交回复
热议问题