Code Monkey home page Code Monkey logo

Comments (9)

MathieuAA avatar MathieuAA commented on July 17, 2024

I don't think it's JHipster-UML's job to be able to parse Java classes, or to even care about Java. However, it would be a pretty good idea that this parsing results in the creation of a JDL file =) (it has been made to represent JHipster entities...).

@CarlKlagba, what do you think about this?

from jhipster-uml.

cbornet avatar cbornet commented on July 17, 2024

Well, from its name, Jhipster is a bit about Java ;-).
I think this could be made in complete compatibility with what exists currently : map both BigDecimal dataType and java.math.BigDecimal to JHipster's BigDecimal and have an optional package name (with root as default) in the command line (the notion of package exists in UML, not only in java).
I could help on a PR if you want.

from jhipster-uml.

cbornet avatar cbornet commented on July 17, 2024

Great tool BTW ! I was really amazed when I generated a jhipster working REST server from an existing dropwizard project in about 20 minutes !

from jhipster-uml.

MathieuAA avatar MathieuAA commented on July 17, 2024

Yes, JHipster is about Java, but JHipster-UML is not really about it. JHipster-UML focuses on JHipster and, above all else, its entities.

Could you precise what you mean by map both BigDecimal dataType and java.math.BigDecimal to JHipster's BigDecimal?

from jhipster-uml.

cbornet avatar cbornet commented on July 17, 2024

I mean treat classes inside "java.*" package like PrimitiveType/DataType. Thus if a field has a relationship to java.math.BigDecimal, it is mapped to a JHipster field (instead of a relationship) with fieldType "BigDecimal".

from jhipster-uml.

cbornet avatar cbornet commented on July 17, 2024

I continued looking at how to use the xmi produced by modelio's reverse and there are other things that need to be changed such as relationships.
So I guess this is out of scope of jhipster-uml and could maybe be part of another conversion tool.

The steps I had to perform in order to use my reverse if that interests somebody:

  • Delete every #import java.time.LocalDate, #import java.math.BigDecimal from the java domain files so that the types don't end up as associations to JDK classes.
  • Add Java Designer module to the Modelio project
  • Configure the rt.jar lib on the Modelio project
  • Reverse the java domain files:
    • select "complete structural"
    • use the project rt.jar during the reverse
  • Move the domain generated classes to the root level
  • Delete all packages
  • Create the DateTime, LocalDate and BigDecimal data types
  • Edit the classes that have fields with no type and set the correct data type. This can be done with Modelio or by exporting to xmi, edit the xmi, find the data type xmi:id and put it in the type attribute of the field, then reimporting to Modelio.
  • Remove JavaExtensions from the xmi (optional)
  • In Modelio, java bidirectional associations create two associations. The many-to-one one must be deleted.

from jhipster-uml.

MathieuAA avatar MathieuAA commented on July 17, 2024

That may be outside JHipster-UML's scope, but I think of a good way to use this: convert generated Java classes to JDL.
A lot of things can be done if this happens, like converting entites to a JDL file, modifying it instead of the Java classes, and use the modified JDL file to modify the original Java classes in the JHipster app (that could be easier/quicker depending of the user than changing the Java files).

But, concerning your last post, Modelio is to be used to reverse the classes, right? Do you think Modelio is shipped with some kind of API that could enable us to use the reverse?

from jhipster-uml.

cbornet avatar cbornet commented on July 17, 2024

Yes this is the reverse function of Modelio. I think the other editors also have these kind of feature so I will probably have a look at what they produce. As for an API for Modelio, it seems possible to write Jython scripts and launch them from the command-line. I don't know if it is possible to use the reverse that way.

from jhipster-uml.

MathieuAA avatar MathieuAA commented on July 17, 2024

I am closing this thread as it doesn't really concern JHipster-UML as a whole, but could only concern JDL for possible new features (associated or not to JHipster-UML).

from jhipster-uml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.