Usage/meaning of "Difference between new generated and reverse engineered source" dialog box

Occasionally, one gets a very confusing pop-up dialog box titled "Difference between new generated and reverse engineered source" indicating that there is a difference, I think, between the code what the reverse engineering wants to create and the code on the disk. While the affected files are listed, the disputed differences are not detailed in any manner, so the user has no idea what is actually going on.

The dialog box then presents some non-intuitive options to either "create patches", "overwrite the code" (Dangerous when you have no idea what those changes actually are!) and "Rollback changes" (what changes and what does "rollback" actually mean here?).


Most typically, for my students who are struggling to learn how to use UML Lab, the desired result is to synchronize the UML Lab model and diagram to the existing code on the disk. Tthis is because students tend to write all their code in the text editors and then view the resultant diagrams rather than creating the diagrams directly. But it is impossible to discern which of the presented options in the dialog box will achieve this or if any additional steps are necessary, e.g. reparsing the files into the model.


Could someone please explain exactly what the options in this dialog mean and how one would achieve the common use cases of forcing UML Lab to use the existing code on the disk or forcing to use the code resulting from the diagram as being shown?


To the UML Lab developers: Please modify this dialog to make it easier to understand. Even a simple "Help" button would be a great assistance.

Thank you to all in advance!

Comments

  • Hi Swong,

    UML Lab tries to keep model and source code in sync. To ensure this synchronization, it checks after each reverse-engineering run if the code that would be generated from the model matches the existing source code.

    But you are right, the dialog you’re referring to is unclear and needs a revision. But let me explain what the options mean.

    If the code to be generated doesn’t match the existing code (likely because the templates are not working well for bidirectional roundtrip engineering, or because there is a bug) it gives you three possibilities how to go on:
    - Create patches. In this case, there is a textual patch added to the model which is automatically applied while generating code.
    - Apply changes to code: Code is generated according to how the reverse engineering understood it.
    - Rollback changes: Changes to the model (made by reverse engineering) are rolled back.

    > Could someone please explain exactly what the options in this dialog mean and how one would achieve the common use cases of forcing UML Lab to use the existing code on the disk or forcing to use the code resulting from the diagram as being shown?

    -> “Apply changes to code” uses the code resulting from the model

    Note you can also just close the dialog – then nothing happens and model and code are just not in sync. But then you have other possibilities:

    - Right klick in the diagram > “Compare Generated Code”: gives a visual diff editor showing what’s going on and if it is safe to just generate code
    - Generate code: obviously uses the code from the model
    - Right klick on the *.uml file > UML Lab > Reparse All Files: Performs a fresh reverse engineering of all known source code files.

    Hope this helps!
Sign In or Register to comment.