

Ask HN: UML-like diagrams for Lisp? - cantelo

After some years programming in Java and OO languages, I&#x27;m looking for a change and started learning Clojure and LISP.<p>When designing a new application in Java or another OO language, I can sketch on a paper or imagine some UML diagrams that help me get an overview of the most important parts of the application. I find them useful, sort of a &quot;mind map&quot; for wrapping my mind around the whole application. These diagrams (class, component, objects) give me a high level of abstraction, allowing me to focus on the most important concepts and helping me exclude details that only cause an information overload when understanding the problem at hand.<p>Now, while learning Clojure, I can&#x27;t find an effective way to do the same thing. In OOP, objects and classes fit nicely in an UML diagram, but Clojure&#x2F;LISP functions in an application are many, smaller and so much more difficult to fit in a small, clear diagram.<p>How do you Clojure and LISP experts create a &quot;mind map&quot; diagram for the applications you are building?
======
em7
UML is not only about class diagrams.

If you use classes and objects in LISPs (Common Lisp, Scheme, Clojure...), you
can create the class diagrams and they will work. In Clojure I usually started
(and I've seen others do the same) with some functions which operates over
hash-maps (or a-lists in LISP). And on the end of the day, when I was creating
the interface for call from java, I put the the needed hash-maps to
defrecords. If I did the class diagrams, it was afterwards when the
relationship between records was clear. Honestly, I don't usually create them
anyway even at my work (C#) - only when the releationships between objects are
complex or in some "unexpected" ways.

But other UML diagrams are perfecly applicable even in functional languages.
The component diagram, use case diagram, communication diagram ... they are
universal. The same for E-R diagram - if you use relational database in
functional/logical language, it's sometimes good to have it.

