YUML and
YPL Database Manual
Don Batory
Department
of Computer Science
The
University of Texas at Austin
Austin,
TX, USA
Yuml is
a free web service for drawing UML class diagrams given a Yuml input
specification. As this is a for-profit company, the "free"
service comes with some strings attached. Namely, it will
produce
a pretty class diagram for you provided that your specification is not
too complicated. To
familiarize yourself with Yuml:
:::test/BuildDocumentation/test/x.yuml.yuml:::
- and
Yuml returns this gorgeous picture:
Draw some diagrams of your own. When you feel comfortable,
proceed to the next section.
Yuml
Specifications
A
Yuml specification is elegant. Here is a BNF of a subset of
Yuml that MDELite
uses for class diagrams. Literals (a.k.a. tokens) are in single
`quotes'.
:::src/Yuml/ReadMe.txt:::
Note
that a String token is mentioned above. This not a Java
String, but one that is devoid of the characters:
comma |
, |
left
brace |
[ |
right
brace |
] |
less
than |
< |
greater
than |
> |
minus |
- |
Further,
a semicolon ";" means new
line. Some hints:
- As
Yuml doesn't like "[]" as in "String[]", I use "#" -- so "String[]" becomes "String#".
- As
Yuml doesn't like commas (as in "foo(int x, int y)"), I
simply use blanks between types -- like "foo(int int)".
- As
Yuml has no indicator to distinguish static from non-static, I simply
preface the names of static members
with an underscore -- like "_bar()".
Consider
the following Yuml specification:
:::test/BuildDocumentation/test/y.yuml.yuml:::
Yuml
produces this beauty:

Warning! Do not read
the above specification too deeply! 'Interface;Closable' is a
String. The word 'Interface' means
nothing to Yuml. It could just as well have been 'George', which
also means nothing to Yuml. What Yuml does understand is ';'
(semicolon), which means add a new line. So 'Interface;Closable' produces
a 2-line name in the above figure. And the string 'bind();getLocalAdddress()' means
print strings 'bind()' and 'getLocalAddress()' on
separate lines.
The
YPL Schema
Here
is the YPL schema (ypl.schema.pl), which can encode YUML diagrams as a
database of tuples:
:::libpl/ypl.schema.pl:::
Here
is a translation of (i.e., the database of tuples that
encodes) the specification of the first
figure:
:::trash/outYuml1.txt:::
And
here is a MDELite.ClassYumlParser
translation of the specification of the second
figure:
:::trash/outYuml2.txt:::
Of
course, you can take these databases and convert them back into Yuml specs
using MDELite.ClassYumlUnParser.
See the MDELite Manual
for more
details.
YPL
Constraints
There
indeed are YPL constraints. I have not posted them, as they
are good examples
for homework assignments.