CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeremy D. Miller -- The Shade Tree Developer

Under the hood and working with .Net, TDD, Software Design, and Agile Stuff

Is UML Important?

I'm spending a lot of time today running some *slow* build scripts and FitNesse tests, so I've got time to throw this out.  In my last post I linked to an article by Robert Glass that more or less called into question the usefulness of UML. 

Martin Fowler covers the issues around UML on his bliki here.

I still quite happily use UML in the UmlAsSketch mode, but not nearly as much as I did 4-5 years ago.  I've always claimed that I can teach you everything you really need to know to use UML in 15 minutes (you can just park that "Aggregation vs Composition" argument right next to "Camaro vs Mustang" in the useless bin).  Don't let the length of the bullets below fool you, I do think UML is useful.

Yes

  • It's still the de facto industry markup for describing code
  • It is useful for communicating designs
  • Most software design books use UML notations to describe design concepts.  Learning UML will help you get more out of the existing literature on UML.
  • I like to use it as a "manipulative," a tangible artifact as a thinking aid when working through a design
  • It's a useful tool in your design toolbox

 

No

  • Not every, and maybe not even a majority, of developers find UML to be useful or understandable.  I've simply worked with too many effective developers who do not use UML to consider it necessary.  The effectiveness of UML as a means of communicating a design is essentially eliminated if most of the team doesn't understand UML.
  • UML seems to work best for people that have a visual/kinetic learning style, and not everybody has that learning style
  • There's a point of diminishing returns with creating UML diagrams upfront.  Exceeding that point, and I think it comes fast, is just plain inefficient
  • A fancy looking UML diagram can easily create a false sense of security about a design, leading a team to keep right on chugging down a bad path.  Taking a page out of Scott Ambler's Agile Modeling book, you need to Travel Light and be prepared to challenge or chuck the existing UML diagrams at any time.  I still love the old Bertrand Meyer quote - "Bubbles don't crash."
  • Executable UML:  Pipe dream.  Maybe graphical DSL's will take off and be the bee's knees (I'm dubious on that score as well).  The idea of Executable UML with reams of OCL adornment being a more efficient means of producing software makes me say - "I'm from Missouri, and you're gonna have to show me"
  • UML as a design heuristic.  I don't really find UML to be all that useful as a means of creating a design in the first place.  I tend to scoff at things like ICONIX that are a prescriptive modeling approach to design (draw these x diagrams in this order and a workable design magically pops out the back).  I'm fully prepared to believe these methods work for their originators but I'm extremely doubtful that these methods are universally applicable.

 



Comments

darrell said:

The first con is a non-argument for me.  I'm not going to limit my effectiveness to the least capable member on my team. It's my job to bring him up to a more effective level.
# July 6, 2006 7:36 PM

Jeremy D. Miller said:

Darrell, I agree with you on principle (not that I've ever been very good at it).  In this specific instance though, some of the folks that didn't understand UML *were* strong developers.  Strong or weak, many developers just don't find UML to be useful.  As a lead type I'd rather switch to another mode of communication or visualization to accomodate their thinking and learning style than force them to read UML.
# July 7, 2006 9:25 AM

Zombeast said:

Lets be honest though, is it really that hard to learn UML? If you can program, you can read UML, its not that hard. Just a thought. :)
# July 9, 2006 6:41 PM

Vikas Kerni said:

In my experience, some strong developers don’t like modeling rather than UML. They see modeling as a waste to time. They would prefer rather to explain design decisions in plain text or verbally. One argument is that hardly any detailed battle plan survives the contact with enemy. Another valid point is that you don’t get anything out of detailed modeling. Visio code generation or synchronization with code changes are poor or none. I think that Visual Studio Team System’s Class Designer is a step in right direction.


http://vikasnetdev.blogspot.com/2006/07/do-some-strong-developers-hate-uml.html
# July 10, 2006 8:43 AM

Jo said:

My first query is, are we just talking class diagrams here?

I am currently working on my IT degree after many years in programming and systems design. In that time I have used ERD's/data models and found them very useful - but UML?? My head just can't deal with it. I barely passed the systems design paper which mostly involved UML. But in OO programming and database design I got A+.  So, yes, I think it doesn't work for all.

I suspect that Class diagrams might be very useful but I spent most of my time trying to 'get' Use Class, Activity, Sequence and Communication diagrams.

My mind couldn't deal with the 'grey' areas. I'm a logic person - black and white work for me. I got stuck with quesions like:
Do I diagram this?
Is this too much detail? not enough?
Why is this diagram needed anyway?
Who will look at it? why?
Who *is* the actor anyway in this Use Case digaram?
How come there is different notation for the same thing? How do I standardise?
Plus I was 'fighting'with Visio all the way.

The rest of the class just did it by 'rote' - whatever it takes to pass. I need to know but questions slow up class for others who aren't interested. At times I felt I was going crazy. And I thought systems design was going to be the most 'fun' of all my subjects! Well, I'm not going there again!
# July 11, 2006 8:22 PM

survic said:

People do not like UML because just as Vikas pointed out: they do not like “domain modeling”; and the reason that they do not like “domain modeling” is that “data modeling” is sufficient already; the extra “domain modeling” is waste of time.

Note that UML is now a superset of ER, so, you may say, if we use UML to do the data modeling, then, people will love UML ;-).

I want to point out that excluding “data modeling” from “domain modeling”, or, thinking “domain modeling” is OO only, instead of both database and OO, is the leftover of an old myth that DABs are in charge of database table design.

Nowadays, because programming is so “easy” (because .net or java is so powerful), and also because SQL Server (or Oracle, DB2) is so “easy” also, developers are in charge of both data design and OO design (i.e. programming design). As a result, “domain modeling” includes “data modeling”. Also, data modeling should be done first. Further, in most projects, most OO modeling should be simply copied from the data model; and therefore a separate OO domain modeling per se is totally unnecessary.

For more details, go to:

http://survic.blogspot.com/2006/07/domain-modeling-or-data-modeling.html

I copied the content here to explain why data modeling is the first and often the last (i.e. sufficient):

(a) Users do not care “objects”. They care UI, and the fact that the data on the UI are saved in databases. So, by definition, UI and the key data are the “business language”; objects are not.

(b) The pragmatic inevitability of Anemic Domain Model http://www.martinfowler.com/bliki/AnemicDomainModel.html-- OK, just in case I am not clear enough, I am saying that although sounds terrible, anemic domain model is a good thing. -- Just as others pointed out, OR mapping encourages this. Again, a lot of people believe it is a bad thing (and therefore, OR mapping is a bad thing!), I believe it is a good compromise.

(c) Part of the reason of (b) is that > 80% of the function of an application is “data CRUD”; so, why bother domain model.

(d) Because of all above, domain model can be “skipped” at least for smaller projects; for larger projects, it is certainly a good exercise. However, even in the latter case, the first-cut of the major database tables should be done first; therefore, the key objects should be “copied” from data model. The key reason is, of course, users (see (a)). This is crucial. You may find ways to “bypass” the data modeling phase, and say that you start with a “domain model”. However, if you think of the reason how you get the major objects done, it is always “we need those key data”! OK, the value of being honest to ourselves? – Time saving: > 90% of the domain model can be done within one or two days, after data model is done. And data model is much easier to do, because you can get help from users directly. You may say, how about the rest 10%? – Those are the low-level objects, they are implementation oriented; and we should not talk about them with users anyway.

# July 22, 2006 4:21 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Jeremy D. Miller

Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy previously worked as a systems architect building mission critical supply chain software for a Fortune 100 company and learned agile development practices as a .Net consultant at ThoughtWorks, one of the pioneers of agile development. Jeremy is the author of the open source StructureMap (http://structuremap.sourceforge.net) tool for Dependency Injection with .Net and the forthcoming StoryTeller (http://storyteller.tigris.org) tool for supercharged FIT testing in .Net. Jeremy's thoughts on just about everything software related can be found on his weblog "The Shade Tree Developer" at http://codebetter.com/blogs/jeremy.miller, part of the popular CodeBetter site. Jeremy is a Microsoft MVP for C#. Check out Devlicio.us!

This Blog

Syndication

News

All opinions expressed here constitute my (Jeremy D. Miller's) personal opinion, and do not necessarily represent the opinion of any other organization or person, including (but not limited to) my fellow employees, my employer, its clients or their agents.

About Me

"Best Of" Compendium

StructureMap (Dependency Injection for .Net)

StoryTeller (Supercharged Fit)

Build your own Cab

TestDriven

MVP