News for hackers. Stuff that matters.
Re:UML in Practice by aggronn on Thursday June 13, 2013 @05:02PM (#5876561)
In school, UML seemed like a great idea. It wasn't very fun, but it was useful, and if you had a simple class project, UMLs certainly made things simpler if you were even okay at them.

When I got my first job, however, there were no UML diagrams. I was saddened to see this. I don't remember if I was surprised, but I was so sure that I would been useful to have a detailed UMI diagram available for studying the codebase.

So, as I got acclimated to the codebase, I took it upon myself to start putting together a UML for our existing product, so that training new people would be easier. After spending several days doing this, my opinion or UML changed dramatically for a couple of reasons:

1) Pretty much all of the UML tools out there are not a pleasure to use. Drawing UML diagrams was still infinitely better than using the various programs I tried. But drawing them on anything but a whiteboard wasn't scalable to the size of the project.

2) Once I had the basic classes drawn out, and realized how diverse the kinds of classes we had were, it became apparent that this just wasn't going to happen. A basic flowchart of the application would be equally valuable. The specificity of UML wasn't worthwhile, having a class with 10+ subclasses was a mess.

3) What I did have was hard to see. This goes back to the first point--the tools are not good. When you labored over all the clicking and dragging, you pulled together this monster of a graph that you can only see a small portion of at a time in a given screen. It was easy to get lost. Printing wasn't useful.

Ultimately, I only ended up using UMLs when we were thinking about how we were going to build out new features, or redesign stuff. It was a .NET shop building a Silverlight app, so serialization and strict static typing was critical. A decent JSON api would have made life easy, but since the back end and the front end were essentially all the same thing, class diagrams were very useful. So for the 2 or 3 times that we had to develop or redo class serialization while I was there, it came in handy only for working on small 2-5 class models.

That brings us to the next point: do class diagrams have a place in an increasingly dynamically typed world? Functional programming in javascript. Frameworks that have their own detailed class system, or which aren't even class oriented.

UML has essentially become analogous to cursive. You learn about it early on, and its important to have a notion of how to read it. But ultimately, since we don't use it every day, we basically never use it.

Re:UML in Practice by JesseAldridge on Thursday June 13, 2013 @08:25PM (#5877600)
I had a similar experience. I've found a good happy medium is Graphviz. It's a bit different in that rather than drawing boxes and arrows on a canvas you edit a .dot file in your text editor and then have the tool do the layout and rendering. Having the layout happen automatically leads to some not-so-great looking graphs, but it ends up saving you a lot of time. Simply putting arbitrary text in nodes and connecting them via labeled edges gives you a lot of flexibility. When a graph gets too big and unwieldy (20+ nodes), I just split it in two. I'll color a node red to indiciate that there is more information about that node in another .dot file.

You do have to learn the .dot syntax, but it's nothing too crazy. A nice bonus is (at least with the OSX version of Graphviz) every time you save a .dot file via your text editor the renderer automatically re-renders the graph for you -- so you can make quick edits and get that instant feedback.

Re:UML in Practice by dunham on Thursday June 13, 2013 @10:17PM (#5877923)
I like using graphviz for visualizing existing code and data. I write a script to generate the .dot file, maybe tweak it a little, and render with graphviz. I've used this for our data model, ER diagrams, jar dependencies, brew package dependencies, etc.

For class diagrams, I have a little python script that takes a language like:

   Foo -> Bar
   Bar *--1 Baz
   
   Foo
   - name : String
   - flag : boolean
And turns it into a diagram. (gist: https://gist.github.com/dunhamsteve/5274411 )
Re:UML in Practice by jared314 on Thursday June 13, 2013 @07:03PM (#5877197)
There was a post, a little while ago, asking why developers disliked creating documentation. The only response that resonated with me was the double-work required to keep it in sync with the code base. The same can be said of UML and ER diagrams. Only the round-trip tools feel worth the effort to learn, because you can choose to use them when they are useful to you.
Re:UML in Practice by styluss on Thursday June 13, 2013 @05:16PM (#5876643)
Have you tried Umlet http://www.umlet.com/ ?
Re:UML in Practice by aggronn on Thursday June 13, 2013 @08:08PM (#5877533)
Thats actually what I had settled on using, and I think its a fine tool. But even umlet doesn't make writing and viewing large UML diagrams...pleasurable? In the sense that we have tools like vim, word, excel, and chrome that are very polished and allow you to get to work quickly and accurately. Even with umlet, i find myself worrying about the interface too much.

I suspect its more of a problem with the fundamental design of UML though. I think if there was like, a UML-lite spec or something. To me, i feel like UML is to what I want to use as XML is to JSON (or csv for that matter), if that makes any sense.

Re:UML in Practice by bobm_kite9 on Sunday June 16, 2013 @09:54AM (#5888437)
(plug starts)

Can I also suggest Kite9?

www.kite9.com/kite9/gui.html

Which does automatic diagram layout. It's not quite doing UML yet, but a reasonable approximation thereof. It's more visual/drag-and-drop than UMLet.

I intend to include a suite of actual UML symbols within the next week or so.

Hopefully this will be useful to you!

(end plug)

Re:UML in Practice by bane on Thursday June 13, 2013 @07:58PM (#5877476)
wow this looks remarkably good...at last somebody "gets" why incessant mousing around and piling through menus is a bad way to do things.
Re:UML in Practice by QEDturtles on Thursday June 13, 2013 @05:33PM (#5876732)
Looks promising, Thanks!
Re:UML in Practice by davesims on Thursday June 13, 2013 @08:25PM (#5877597)
> That brings us to the next point: do class diagrams have a place in an increasingly dynamically typed world?

I think so, at least in environments where OOP is the base metaphor, like Ruby or Python. I can't think of any major impedance to creating meaningful class diagrams for, for instance, a system of ActiveRecord relationships. RubyMine (last time I used it) actually will generate a nice class diagram for you based on the given ActiveRecord/schema definitions.

For me these days, since not many coders use it, I find UML mostly helpful as a personal tool I use to understand a new codebase or a complicated design/data modeling problem.

I also find sequence diagrams really helpful, particularly in complex async, service-oriented environments where many times there's just too much state to track and too many moving pieces to really see the essence of the problem.

UML is not everybody's cup of tea, but I continue to find it a valuable way to visualize complex code relationships, often times surfacing problems/solutions that would not have been as transparent just from reading the code.

Re:UML in Practice by bobm_kite9 on Sunday June 16, 2013 @09:48AM (#5888423)
I was sitting on a swing today, thinking about this line of thinking. UML is getting out of date, I've thought so before:

http://www.kite9.com/content/muddle-uml

I've also thought about what I would like in a modern visual language, but all of that was from a strongly-typed (typically Java) POV.

Having spent a lot more time with JavaScript & Ruby recently, I am now thinking that surely there is a need for a notation for dynamically typed languages. What the hell would that look like though? Anyone interested in trying to figure it out with me?

Re:UML in Practice by wolfgke on Thursday June 13, 2013 @08:08PM (#5877532)
OT: you write "UML has essentially become analogous to cursive. You learn about it early on, and its important to have a notion of how to read it. But ultimately, since we don't use it every day, we basically never use it."

I come from Germany, where nearly everybody handwrites in cursive for text longer than a few words. And I must say: it's a lot faster than writing in block letters (of course writing in shorthand would be even faster - I don't understand why this isn't taught in schools anymore - my father could and took this as elective course).

So: what is the reason why writing in cursive is disliked in the US?

Re:UML in Practice by aggronn on Thursday June 13, 2013 @08:14PM (#5877556)
You usually learn cursive around the age of 7, while the teacher insists that cursive is all you will ever use once after that. In high school, I was told all the time that they only accept cursive in college.

I think the movement away from cursive is relatively recent, and entirely associated with the fact that virtually no teacher or professor will accept work that isn't typed up. You learn cursive in 3rd grade, then from there on all of your work is done on computers so you never reinforce it.

Re:UML in Practice by ollysb on Thursday June 13, 2013 @08:24PM (#5877595)
I had to look up what cursive was, for me that's just what you call handwriting. Are you saying that there's a move towards non-joined up handwriting?
Re:UML in Practice by kevincrane on Thursday June 13, 2013 @08:36PM (#5877640)
In America, what you call "non-joined up handwriting" we call "handwriting". I don't know anyone (anecdotally) that uses cursive on a daily basis except for signing checks and contracts.
Re:UML in Practice by ollysb on Friday June 14, 2013 @03:14AM (#5878691)
Non cursive hand seems like an incredibly slow way to write, impractical for classes etc. is this because everyone is bringing a laptop to class and just doesn't write much at all? I'm from the UK and as far as I know they still move kids into cursive as soon as possible. From personal experience at school I recall the quality of my writing was dramatically improved once I moved to a computer so I can understood a move in that direction. I'm just surprised cursive isn't still used because for note taking situations it is still incredibly useful.
Re:UML in Practice by ensignavenger on Friday June 14, 2013 @10:25AM (#5880076)
Handwriting generally refers to both joined and non-joined writing. If there is a need to distinguish, usually people say cursive or print. As in "Print your name and sign below..."

Cursive in my experience is very difficult for someone other than the writer to read- even when it is written neatly, it is more difficult to read than print or type with a decent font selected :)

Re:UML in Practice by sourpoi on Thursday June 13, 2013 @08:33PM (#5877624)
Of the free GUI tools, BOUML (the old, open v4.21 in Fedora 18) had the best combination of available UML components and editing flow. BOUML was restricted/automated enough to give me the impression that I was describing relations more I was drawing them.

However, at the end of the rainbow I found PlantUML. PlantUML renders nice graphs using a GraphViz/Dot-like language and affords all the benefits of being plain text - revisions are intelligible, syntax is highlightable, and edits flow at the speed of Vim.

http://plantuml.sourceforge.net/

Re:UML in Practice by andrewcooke on Thursday June 13, 2013 @08:11PM (#5877542)
at least when i last had to use them, none of the free uml tools were much good, but enterprise architect is not very expensive (at least in some editions) and surprisingly good. it would probably have been able to auto-create your uml for you from your code base, for example. and it's much more than a diagram editor - it's a tool to help you construct a "database" (in some abstract sense) of your design, which can then be rendered in various ways (as diagrams or code).

http://www.sparxsystems.com/products/ea/ (i've never used uml "from end to end" - in terms from the article i mainly communicate with shareholders. i'm also unrelated to EA - just have happy (well...) memories of it. in fact, apart from intellij idea, it's the only software i've ever paid for, i think).

Re:UML in Practice by bane on Thursday June 13, 2013 @07:49PM (#5877434)
> Once I had the basic classes drawn out, and realized how diverse the kinds of classes we had were

You'd think there'd be a tool you could point at your repository and have it spit out appropriate UML. As a set of description diagramming techniques UML can be useful.

Re:UML in Practice by camus on Thursday June 13, 2013 @06:40PM (#5877079)
A uml design tool could easily be created in the browser , with export to different languages ... a few weeks ago i began building a class diagram designer ( uber limited ) http://umldesigner.herokuapp.com/ , as a proof of concept . Lucidcharts provides a more complete one.

UML is helpfull for comunicating ideas ,etc ... but i dont believe in RAD tools based on drawing class diagrams,these tools never work properly.

Re:UML in Practice by dmgrow on Thursday June 13, 2013 @07:29PM (#5877333)
Thanks for the mention of Lucidchart (http://www.lucidchart.com). If there is any specific feedback on the app, would love to hear it -- and good luck with your tool!