Skip to content

Commit

Permalink
Merge pull request jhipster#133 from MathieuAA/patch-5
Browse files Browse the repository at this point in the history
Update jhipster_uml.md
  • Loading branch information
jdubois committed Dec 9, 2015
2 parents 1914776 + bfd7773 commit f218d94
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions jhipster_uml.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ layout: default
title: JHipster-UML
sitemap:
priority: 0.5
lastmod: 2015-12-08T12:00:00-00:00
lastmod: 2015-12-09T12:00:00-00:00
---

# <i class="fa fa-magic"></i> JHipster-UML


JHipster-UML is a JHipster sub-project which can be used as a replacement to using the [entity sub-generator]({{ site.url }}/creating_an_entity.html). The idea is that it is much easier to [manage relationships]({{ site.url }}/managing_relationships.html) using a visual tool than with the classical Yeoman questions and answers.
JHipster-UML is a JHipster sub-project that can be used as a replacement to using the [entity sub-generator]({{ site.url }}/creating_an_entity.html). The idea is that it is much easier to [manage relationships]({{ site.url }}/managing_relationships.html) using a visual tool than with the classical Yeoman questions and answers.

The JHipster-UML project is [available on Github](https://github.com/jhipster/jhipster-uml), it is an Open Source project like JHipster (Apache 2.0 licence). If you like this project, don't forget to give us a star on GitHub!

Expand Down Expand Up @@ -49,8 +49,8 @@ Here is a list of the editors we support:

- [Modelio](https://www.modeliosoft.com/);
- [UML Designer](http://www.umldesigner.org/);
- [GenMyModel](https://www.genmymodel.com/) (not free);
- [Visual Paradigm](http://www.visual-paradigm.com/) (not free, but proposes a community edition).
- [GenMyModel](https://www.genmymodel.com/) (not free, but online);
- [Visual Paradigm](http://www.visual-paradigm.com/) (not free).

***

Expand All @@ -65,7 +65,7 @@ Please use our project for submitting issues and Pull Requests:

Please note that using JHipster-UML (or JHipster) might be troublesome (one has to install some tools to really be able to use the Node environment without any issue). This [link](https://gist.github.com/nullivex/7115612) may help if you encounter an issue on Windows.

Another issue that can be encountered on windows is [this one](https://stackoverflow.com/questions/30344858/node-script-executable-not-working-on-mac-env-node-r-no-such-file-or-directo#answer-30349952). The link provides a solution to fix that.
Another issue that can be encountered on windows is [this one](https://stackoverflow.com/questions/30344858/node-script-executable-not-working-on-mac-env-node-r-no-such-file-or-directo#answer-30349952). The link provides a solution to fix that if such a thing happens.

***

Expand All @@ -74,7 +74,7 @@ To install JHipster-uml simply use the command:

`npm install -g jhipster-uml`

If you want the 'bleeding edge' version, you can clone our git repo from [our Github project](https://github.com/jhipster/jhipster-uml):
If you want the 'bleeding edge' (almost perfectly safe to use) version, you can clone our git repo from [our Github project](https://github.com/jhipster/jhipster-uml):

`git clone https://github.com/jhipster/jhipster-uml.git` for HTTPS

Expand Down Expand Up @@ -123,7 +123,7 @@ Notice that in order to achieve a unidirectional relationship we just removed th

In this bidirectional relationship, an Owner can have many cars, and a Car can have only one owner.

Unidirectional relationships are not supported (yet) by JHipster (see [this](managing_relationships.html#3) page for more information about this).
Unidirectional relationships for One-to-Many relationships are not (yet) supported by JHipster (see [this](managing_relationships.html#3) page for more information about this).
This is an example of such an association:

![One-to-Many2](images/jhipsteruml_uni_otm.png)
Expand Down Expand Up @@ -485,7 +485,7 @@ The 1.0.0 release brings a new parser system making any change (parser creation,

#### Parser implementation

Adding a parser is quite easy. If your a Java dev, you're probably quite familiar with OOP principles (we hope so anyway). When developing JHipster-UML, we thought of its architecture as we'd _normally_ do in Java.
Adding a parser is quite easy. If you're a Java dev, you're probably quite familiar with OOP principles (we hope so anyway). When developing JHipster-UML, we thought of its architecture as we'd _normally_ do in Java.

You just have to "extend" our abstract parser ([AbstractParser](https://github.com/jhipster/jhipster-uml/blob/master/lib/editors/abstract_parser.js)), or implement our interface ([Parser](https://github.com/jhipster/jhipster-uml/blob/master/lib/editors/parser.js)) to add your concrete implementation of a parser.

Expand Down Expand Up @@ -520,21 +520,21 @@ However, a few guidelines must be respected:

- The editor's class name must be capitalized (Modelio -> `ModelioParser`, UML Designer -> `UMLDesignerParser`).

Concerning the EditorDetector, it can detect the editor that created your XMI file. For that to happen, you must first locate where the editor is mentionned in the XMI file, and then add the code that returns your editor just like [here](https://github.com/jhipster/jhipster-uml/blob/master/lib/editors/editor_detector.js#L19). If your editor can't be detected, add it [here](https://github.com/jhipster/jhipster-uml/blob/master/lib/editors/editors.js#L23), and indicate its name just like it has been done for UML Designer [here](https://github.com/jhipster/jhipster-uml/blob/master/lib/editors/editor_detector.js#L56).
Concerning the EditorDetector, it can detect the editor that created your XMI file. For that to happen, you must first locate where the editor is mentionned in the XMI file, and then add the code that returns your editor just like [here](https://github.com/jhipster/jhipster-uml/blob/master/lib/editors/editor_detector.js#L23). If your editor can't be detected, add it [here](https://github.com/jhipster/jhipster-uml/blob/master/lib/editors/editors.js#L23), and indicate its name just like it has been done for UML Designer [here](https://github.com/jhipster/jhipster-uml/blob/master/lib/editors/editor_detector.js#L56).


#### Testing

Finally, the next thing you'll need to do before committing your super parser is test it.
Because we believe in testing, but really like good testing (with BDD), our tests are done with Mocha and chai. If you don't know what it's all about yet, we recommend you visit the [ChaiJS](http://chaijs.com/) page, and see [one](https://github.com/jhipster/jhipster-uml/blob/master/test/modelio_parser_test.js) of our test file to get acquainted with it.
Because we believe in testing, but really like good testing (with BDD), our tests are done with Mocha and chai. If you don't know what it's all about yet, we recommend you visit the [ChaiJS](http://chaijs.com/) page, and see [one](https://github.com/jhipster/jhipster-uml/blob/master/test/editors/modelio_parser_test.js) of our test file to get acquainted with it.

You should probably wonder what form of testing you should use. The answer is pretty simple: it's up to you! Whether it's [should](http://chaijs.com/guide/styles/#should), or [expect](http://chaijs.com/guide/styles/#expect) (à la RSpec), we don't enforce any special rule here.
You should probably wonder what form of testing you should use. The answer is pretty simple: it's up to you! Whether it's [should](http://chaijs.com/guide/styles/#should), or [expect](http://chaijs.com/guide/styles/#expect) (à la RSpec), we don't enforce any special rule here. We, however, recommend using Expect because we do, and it should keep the tests fairly easy to understand.

We just want you to test everything that is 'test-worthy':

- The interface's methods (the _public_ methods);
- The interface's methods (the _public_ methods not an interface class!);

- You're not obliged to test the other methods (_private_ ones, because they are supposed to be safe and ever-changing in the long term), but as visibility is not implemented in JS (to our knowledge), you may want to test them (it's up to you).
- You're not obliged to test the other methods (_private_ ones, because they are supposed to be safe and ever-changing in the short/long term), but as visibility is not implemented in JS (to our knowledge), you may want to test them (it's up to you).

The general guidelines for names and files:

Expand All @@ -556,7 +556,7 @@ Don't forget to modify the [editor detector](https://github.com/jhipster/jhipste
Removing a parser is quite an easy thing to do.
First, remove it from the editors (`editors/editors.js`) and then remove it from the EditorDetector (`editors/editor_detector.js`). Finally, just remove the parser file and the test created for it.

Don't forget to modify the [editor detector](https://github.com/jhipster/jhipster-uml/blob/master/lib/editors/editor_detector.js#L38) if you delete any parser
Don't forget to modify the [editor detector](https://github.com/jhipster/jhipster-uml/blob/master/lib/editors/editor_detector.js#L38) if you delete any parser.

***

Expand All @@ -582,9 +582,9 @@ The entity declaration is done as follows:

- and as an option `<validation>` the validations for the field.

The possible validations are those described [here](#annexes), if the validation requires a value, simply add `(<value>)` right after the name of the validation.
The possible typzq and validations are those described [here](#annexes), if the validation requires a value, simply add `(<value>)` right after the name of the validation.

Here's an example of a field declaration with validations:
Here's an example of a field declaration with validations:

email String required maxlength(30) minlength(5) pattern("[\\w]*@[a-zA-Z]*.com"),

Expand All @@ -603,7 +603,6 @@ The relationships declaration is done as follows:
- `<relationship name>` is the name of the relationship in the entity.



Here's an simple example:

A Book has one Author, an Author has several Books.
Expand All @@ -623,7 +622,7 @@ A Book has one Author, an Author has several Books.
}

### Relationships
The relationship OneToMany A to B is equivalent to the relationship ManyToOne B to A, you only need to make one of them.
The relationship OneToMany A to B is equivalent to the relationship ManyToOne B to A, you only need make one of them.

The field used to represent a relationship is, by default, `id`. This can be modifed with the following syntax for the `<relationship name>` token above: `<relationship field>(<display field>)`.

Expand Down Expand Up @@ -700,7 +699,7 @@ JHipster-UML possesses its own kind of comment:
// an ignored comment
/** not an ignored comment */

Therefore, anything that starts with `//` is considered an internal comment for JHipster-UML, and will not be counted ad Javadoc.
Therefore, anything that starts with `//` is considered an internal comment for JHipster-UML, and will not be counted as Javadoc.


## <a name="options"></a>Using JHipster's options
Expand Down

0 comments on commit f218d94

Please sign in to comment.