Open HeroGamers opened 2 years ago
I really like this this idea!
There was already a suggestion here: https://github.com/plantuml/plantuml/issues/39#issuecomment-474405783
Really like this idea too.
I've started work on an implementation for this. It's mostly done, I just need to change the shape of the relationships and tweak how the layout is done. https://github.com/Benjamin-Davies/plantuml/tree/cheneer
It would be good to get some feedback on the syntax.
@startchen movies
entity DIRECTOR {
key attribute Number
attr Name {
Fname
attribute Lname
}
attribute Born
attribute Died
attribute Age
}
entity CUSTOMER {
key attribute Number
derived attribute Bonus
multi attribute Name
}
entity DVD {
key attribute Code
}
relationship RENTED_TO {
-1 CUSTOMER
-N DVD
-(N,M) DIRECTOR
attribute Date
}
@endchen
@Benjamin-Davies:
Here are some first questions, for the syntax point of view:
E
, on Chen EER
?long name
and alias
?
entity "Nice Director" as DIRECTOR {...
stereotype
for styling ?
entity DIRECTOR <<pink>> {...
Regards, Th.
@Benjamin-Davies
Looks nice - I do have some feedback/questions for the syntax:
CUSTOMER -1- RENTED_TO
RENTED_TO -N- DVD
RENTED_TO -(N,M)- DIRECTOR
key
to some of the attributes, but wouldn't it be an idea to keep it similar to how the current Crow's Notation is made in PlantUML, such that the biggest difference actually is the layout, structure and shapes, but otherwise keeps the same way of writing itattribute Born : TIMESTAMP
?But otherwise great work!
Best regards, Marcus
- Just for my comprehension, what is the meaning of the first
E
, onChen EER
?
The first E in EER stands for enhanced or extended (see Wikipedia). All ER diagrams are also EER diagrams, but EER adds support for subclassing of entities.
All of your suggestions look good. I'll probably end up dropping the "attribute" keyword and moving "key" etc. to be stereotypes, for consistency with other PlantUML diagram types.
So what is the actual syntax now?
@startchen movies
<style>
.red {
BackGroundColor Red
FontColor White
}
.blue {
BackGroundColor Blue
FontColor White
}
</style>
entity "Director" as DIRECTOR {
"No." as Number <<key>>
Name {
Fname
Lname
}
Born : DATE
Died<<red>>
Age<<blue>>
}
entity "Customer" as CUSTOMER {
Number <<key>>
Bonus <<derived>>
Name <<multi>>
}
entity "Movie" as MOVIE {
Code
}
relationship "was-rented-to" as RENTED_TO {
Date
}
RENTED_TO -1- CUSTOMER
RENTED_TO -N- MOVIE
RENTED_TO -(N,M)- DIRECTOR
entity "Parent" as PARENT {
}
entity "Member" as MEMBER {
}
CUSTOMER ->- PARENT
MEMBER -<- CUSTOMER
entity "Kid" as CHILD <<weak>> {
Name <<key>>
}
relationship "is-parent-of" as PARENT_OF <<identifying>> {
}
PARENT_OF -1- PARENT
PARENT_OF =N= CHILD
entity "Little Kid" as TODDLER {
FavoriteToy
}
entity "Primary-Aged Kid" as PRIMARY_AGE {
FavoriteColor
}
entity "Teenager" as TEEN {
Hobby
}
CHILD =>= d { TODDLER, PRIMARY_AGE, TEEN }
entity "Human" as PERSON {
}
PERSON ->- U { CUSTOMER, DIRECTOR }
@endchen
ok found it in the implementation added some spacing and color examples
Hi all,
Here is the corresponding image:
Doc. can be improve here:
Thanks for your contributing... Regards, Th.
@The-Lum I fixed links between ER and IE, and added a last section "Complex Example" with the above example
I looked around for quite a while, and tried to see if anyone had made it possible to use the Chen notation in PlantUML yet, and I could only find the old Issue for the Crow's Foot notation (#39), yet no apparent implementation for the Chen notation, which is what I'm being taught in university, and which seems to be used widely (though it might be an older notation..?)
I'd definitely appreciate having the notation added to PlantUML, and I bet it would be great for others as well!
Some references: https://vertabelo.com/blog/chen-erd-notation/ https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model#/media/File:ERD_Representation.svg Chapter 6 of Database System Concepts (https://www.db-book.com/)