New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Information Engineering (IE) data modelling notation support. #31

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
2 participants
@mgeorge

mgeorge commented Jan 19, 2017

Extended @bminderh's crowsfoot work to include the full IE notation except for OR/XOR.

Includes

  • All IE extremities
  • A new 'mandatory' visibility modifier '*' produces a black circle
  • A syntax alias 'entity' which is aliased to 'class'

Diagram example

@startuml

hide circle
hide empty members

entity Entity {
   * identifying_attribute
   --
   * mandatory_attribute
   optional_attribute
}

' zero or one
A |o--o| B

' exactly one
C ||--|| D

' zero or many
E >o--o< F

' one or many
G >|--|< H

@enduml

To do

Couldn't work out how to do the following myself.

  • Make mandatory visibility icon color based on attribute text color. Currently hard-coded to black which is not ideal.
@mgeorge

This comment has been minimized.

Show comment
Hide comment
@mgeorge

mgeorge Jan 19, 2017

The above syntax would produce the following diagram.
ie-demo

mgeorge commented Jan 19, 2017

The above syntax would produce the following diagram.
ie-demo

@arnaudroques

This comment has been minimized.

Show comment
Hide comment
@arnaudroques

arnaudroques Jan 19, 2017

Contributor

That's great! Congratulation for your work. We will be glad to merge this in the base branch.
And we will have a look at the hard-coded black issue.
We just have a syntax suggestion: wouldn't it be more logical to use { instead of < to be consistent with exising crowsfoot notation ?
That is, using:
E }o--o{ F
G }|--|{ H

What do you think about it ? (You don't have to do the code modification, we could if you want).

Contributor

arnaudroques commented Jan 19, 2017

That's great! Congratulation for your work. We will be glad to merge this in the base branch.
And we will have a look at the hard-coded black issue.
We just have a syntax suggestion: wouldn't it be more logical to use { instead of < to be consistent with exising crowsfoot notation ?
That is, using:
E }o--o{ F
G }|--|{ H

What do you think about it ? (You don't have to do the code modification, we could if you want).

@mgeorge

This comment has been minimized.

Show comment
Hide comment
@mgeorge

mgeorge Jan 20, 2017

Using '{' is fine by me. If you could make the change during the merge then that would be great.

Also note that the crowsfoot in this version is smaller and narrower than @bminderh's version. This is because the crowsfoot in both versions do not work well with non-perpendicular angles since one leg may overlap the entity while the other dangles. Smaller and narrower makes this effect slightly less obnoxious. The following image demonstrates what I mean.

test

I thought about trying to dynamically scale the legs to ensure they intersect with the entity, but there are many cases where one leg will never intersect. If users don't like it they always have the option of using the ortho linetype to avoid weird angles.

mgeorge commented Jan 20, 2017

Using '{' is fine by me. If you could make the change during the merge then that would be great.

Also note that the crowsfoot in this version is smaller and narrower than @bminderh's version. This is because the crowsfoot in both versions do not work well with non-perpendicular angles since one leg may overlap the entity while the other dangles. Smaller and narrower makes this effect slightly less obnoxious. The following image demonstrates what I mean.

test

I thought about trying to dynamically scale the legs to ensure they intersect with the entity, but there are many cases where one leg will never intersect. If users don't like it they always have the option of using the ortho linetype to avoid weird angles.

@mgeorge

This comment has been minimized.

Show comment
Hide comment
@mgeorge

mgeorge Jan 20, 2017

And thank you for accepting this work, and for your great work on PlantUML. I added the IE notation because we will likely use PlantUML as our primary diagramming tool for teaching several software engineering related courses in the Department of Information Science at the University of Otago (New Zealand).

mgeorge commented Jan 20, 2017

And thank you for accepting this work, and for your great work on PlantUML. I added the IE notation because we will likely use PlantUML as our primary diagramming tool for teaching several software engineering related courses in the Department of Information Science at the University of Otago (New Zealand).

@arnaudroques

This comment has been minimized.

Show comment
Hide comment
@arnaudroques

arnaudroques Jan 20, 2017

Contributor

Here is a beta that integrates your code with { modification.
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Note that in V8052 we have patched @bminderh version so that non-perpendicular angles are displayed warped. We've just added a projection to Point2D left and right, see https://github.com/plantuml/plantuml/blob/master/src/net/sourceforge/plantuml/svek/extremity/ExtremityCrowfoot.java

The result is not perfect:

Compare for example:

@startuml
hide circle
hide empty members

foo1 --{ bar1
foo1 --{ bar2
foo1 --{ bar3

aa --o{ bb
aa --o{ cc
aa --o{ dd
@enduml

If you like the result, we could do the same trick with your code.
What do you think about it ?

Contributor

arnaudroques commented Jan 20, 2017

Here is a beta that integrates your code with { modification.
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Note that in V8052 we have patched @bminderh version so that non-perpendicular angles are displayed warped. We've just added a projection to Point2D left and right, see https://github.com/plantuml/plantuml/blob/master/src/net/sourceforge/plantuml/svek/extremity/ExtremityCrowfoot.java

The result is not perfect:

Compare for example:

@startuml
hide circle
hide empty members

foo1 --{ bar1
foo1 --{ bar2
foo1 --{ bar3

aa --o{ bb
aa --o{ cc
aa --o{ dd
@enduml

If you like the result, we could do the same trick with your code.
What do you think about it ?

@mgeorge

This comment has been minimized.

Show comment
Hide comment
@mgeorge

mgeorge Jan 23, 2017

Yes that looks good.

mgeorge commented Jan 23, 2017

Yes that looks good.

@mgeorge

This comment has been minimized.

Show comment
Hide comment
@mgeorge

mgeorge Jan 23, 2017

Just noticed a problem with using the '*' character for the new visibility modifier - it conflicts with the creole bold.

I am fine with you choosing another character for the visibility modifier.

mgeorge commented Jan 23, 2017

Just noticed a problem with using the '*' character for the new visibility modifier - it conflicts with the creole bold.

I am fine with you choosing another character for the visibility modifier.

@arnaudroques

This comment has been minimized.

Show comment
Hide comment
@arnaudroques

arnaudroques Jan 23, 2017

Contributor

Well, we like the * notation :-)

So in the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
we've fixed the following clash:

@startuml
hide circle
hide empty members

entity Entity {
   * identifying_attribute
   --
   * mandatory_attribute **in bold**
   **optional_attribute**
}
@enduml

Tell us if you find other issues,
Thanks

Contributor

arnaudroques commented Jan 23, 2017

Well, we like the * notation :-)

So in the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
we've fixed the following clash:

@startuml
hide circle
hide empty members

entity Entity {
   * identifying_attribute
   --
   * mandatory_attribute **in bold**
   **optional_attribute**
}
@enduml

Tell us if you find other issues,
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment