Comments (9)
Hi!
That's a pretty good idea! But that's the good part =).
Here comes the bad one: my main concern is that the JSON format can't have any comment, and we'd have to add yet another field in the JSON, and this field may (or may not) have a pretty big (in term of string length) value.
But then, the comments could be added directly to the templates, which is nice.
Let's have the input of the JHipster 6 @jdubois, @andidev, @deepu105, @gmarziou, @atomfrede, @gzsombor on this, but you have my "+1".
from jhipster-uml.
We can have the comment text as an optional parameter for the json and that
will be easier to handle so that in Jhipster templates you just need to
print it in a comment block
On 27 Aug 2015 00:47, "Mathieu ABOU-AICHI" [email protected] wrote:
Hi!
That's a pretty good idea! But that's the good part =).
Here comes the bad one: my main concern is that JSON can't have any
comment.We rely too much on the JSON dumped (and consumed) by JHipster that it
would be pretty hard, if not impossible, to achieve this.
That being said, if JHipster could take another format as input, or
another form of input...
The comments could be added directly to the templates.Let's have the input of the JHipster 6 @jdubois
https://github.com/jdubois, @andidev https://github.com/andidev,
@deepu105 https://github.com/deepu105, @gmarziou
https://github.com/gmarziou, @atomfrede https://github.com/atomfrede,
@gzsombor https://github.com/gzsombor on this.—
Reply to this email directly or view it on GitHub
#46 (comment)
.
from jhipster-uml.
@deepu105 suggestion gives a minimal impact on the generator so I say this is doable if wanted.
I could implement this in jhipster if wanted though I would like to have an example of where the comments should be placed and how they should look. I guess as javadoc comments for class and field? Not sure how to handle linebreaks though. Any suggestions on that?
from jhipster-uml.
@andidev Regarding the question if this feature is wanted enough: I think it would be a very useful feature and I would definitely use it. However I have no idea, how the majority of the jhipster-uml users utilize the software and whether it would support their workflow.
Regarding the implementation: class comments appear directly within the packagedElement class, an example produced by Modelio 3.3 looks like:
<packagedElement xmi:type="uml:Class" xmi:id="_lZ6hZkyUEeWd98JY82OrEw" name="MyCoolClass">
<ownedComment xmi:type="uml:Comment" xmi:id="_lZ6hZ0yUEeWd98JY82OrEw">
<body><p>This class represents the Magna ligula pellentesque. Lacus ut sed. Himenaeos litora et posuere. Accumsan purus inceptos. Ultricies praesent metus. /* Fames odio quam. */</p><p>TODO:</p>
<ul>
<li>first &uuml;ber</li>
<li>second</li>
</ul>
</body>
</ownedComment>
</packagedElement>
The body element contains plain html, which could be used as class comment without much modification (xml entity decoding assumed):
/**
* <p>This class represents the Magna ligula pellentesque. Lacus ut sed. Himenaeos litora et posuere. Accumsan purus inceptos. Ultricies praesent metus. /* Fames odio quam. */</p><p>TODO:</p>
*
* <ul>
* <li>first über</li>
* <li>second</li>
* </ul>
*/
@Entity
@Table(name = "MYCOOLCLASS")
public class MyCoolClass {
New lines should be prefixed with " * " for nicer code layout and "*/" or in general slashes should be escaped using corresponding entity (/). Since line breaking is recommended (http://www.oracle.com/technetwork/articles/java/index-137868.html), due to html being insensitive to line feeds, a simple word wrap algorithm could be used:
/**
* <p>This class represents the Magna ligula pellentesque. Lacus ut sed. Himenaeos
* litora et posuere. Accumsan purus inceptos. Ultricies praesent metus. /*
* Fames odio quam. */</p><p>TODO:</p>
*
* <ul>
* <li>first über</li>
* <li>second</li>
* </ul>
*/
Attribute comments appear within <ownedAttribute> elements and should probably be transferred as a comment of the field declaration. Generally I suppose the same rules would apply. Maybe, since Modelio puts even on liners within <p> elements, stripping of enclosing paragraph elements might be a good idea?
from jhipster-uml.
@mkresse yes, parsing the comments from modelio XMI files seems easy, but don't forget the others!
If JHipster adds the support for comments, then JHipster-UML will too. It's an option worth the work.
from jhipster-uml.
So jhipster support for javadoc comments is ready to be merged! see PR jhipster/generator-jhipster#1952 for an example of how the json should look like and what will be generated.
from jhipster-uml.
Ok! It should be ready next week in JHipster-UML (I hope so anyway, if we have time).
Great work by the way!
from jhipster-uml.
Wow, this looks really great - can't wait to try it out. Thanks a lot for your work.
from jhipster-uml.
Closing this thread as the comment support has been added to JHipster-UML, the documentation will soon be updated too.
from jhipster-uml.
Related Issues (20)
- Is Visual Paradigm Supported by Jhipster-uml? HOT 3
- Doesn't support .jdl and .jh files as input HOT 9
- Incompatible type errors on generated code based on UML file. HOT 6
- Support for Sparxsystem Enterprise Architect HOT 5
- Implement contraint support for UML Designer HOT 1
- Error: Cannot read property 'relationships' of undefined HOT 1
- mongoDB + jhipster UML HOT 5
- Array in MongoDB in JDL file. HOT 1
- Generating all the entities from Microservice in Gateway app HOT 1
- microservicename is json file generated by import-jdl
- Add the jpa filter option
- How to modify existing entity generated with jhipster? HOT 1
- After modify my existing entity I generated chane log and put it in master.xml, but after that I run gradlew command I got following probem HOT 1
- Convert JDL to XMI HOT 2
- Bug in docs HOT 2
- Installation of JHipster-UML terminates with error HOT 2
- Cannot read property '0' of undefined HOT 2
- The type 'Instant' isn't supported by JHipster
- Deprecate this project
- Setting up Jhipster-Core for Azure Pipelines
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jhipster-uml.