views:

1742

answers:

19

UML2 offers different kinds of diagrams. Up to now I only used class diagrams.

What kind of UML diagrams do you use? What kinds of diagrams do you recommend for design & documentation of a software project?

+14  A: 

I use following diagrams more frequently:

  1. class diagrams: To explain the class relationship
  2. Sequence Diagrams: To capture object interactions
  3. Activity diagrams: To explain the activities (algorithm flow).

EDIT: Added links as per comment from @Smith325.

aJ
Add links with those names so people can get a good idea of what they are if they don't already know. An easy set of links could point to Wikipedia.
JustSmith
+1  A: 

I will put in a vote for use-case diagrams, as these are about the only UML diagram type that users/clients can actually understand and find relevant to their needs.

anon
I don't quite agree. I develop use cases, but the important part is the description of all the use cases, more than the diagram itself.
David Rodríguez - dribeas
Obviously - but the question was about diagrams. And the use case diagrams are a nice hook to hang analysis discussions on.
anon
+5  A: 

Sequence diagrams are the primary type for me, very little useage of anything else really.

Online tool

Jim T
Very nice site!
bobobobo
A: 

I often use some kind of deployment diagram when modelling the system (though, admittely, I tend to use non-UML stuff in my diagrams as well)

cwap
+2  A: 
  • use cases diagrams: to capture a behavioral requirements
  • sequence diagrams: to capture object interactions

very little or no usage at all of anything else

dfa
+3  A: 

I use state transition diagrams to model the complexity of - well - the different states of a particular application.

paquetp
+3  A: 

Perhaps it would be better to ask what practical benefit do i get from using UML ?

  • UML failed to deliver tools that understand diagrams and spit out templated code.
  • Non technical users dont really understand UML.
  • Do sequence diagrams really capture all the program flow ?
  • Class diagrams - Most people end up with sphaghetti - as they try and put too much in.
  • Use Case Diagrams - are often overly simple they are worthless.
  • RUP - the less said about this the better..

Any diagramming mechanism along with a clear narrative can be used to convey any idea. Just make it legible, clear and logical and it should help be self explanatory.

mP
The practical benefit of UML diagrams is a common language. Sure, any diagramming mechanism can be used but then you have to spend ten minutes explaining your notation and any nuances everytime you show it to someone new. Also, what is clear narrative to the author is seldom clear to others.
Dunk
It's not a common language. Raised by jeff Atwood the only if it's possible to say such a thing amongst users and programmers is English. Groups outside developers , your users don't understand UML. The only true documentation of your system is the code. More intermediate translations
mP
Between the code ( the implementation ) and what your users understand is superfluous and unneccessary. The source of truth for your sock should be INS single lingo that everyone understands - English.Do you really keep your class and other diagrams up to date ? Most of the time they aren't..
mP
and just confuse rather than clarify and communicate knowledge.
mP
I agree that UML is not a particularly good tool. However, it is what we have to work with. It is an attempt at creating a common language for software developers to use. In that sense it is a common language for software developers. BTW, not everyone understands English.
Dunk
Studies have proven that pictures are worth a 1000 words. It is not true for everyone, but most people can grasp the meaning from pictures easier than reading. That is why people use diagrams instead of English. So your English solution is a bit lacking, especially since most people are poor writers
Dunk
Sure thing, do business users or for that matter does anyone truely understand a pic with a zillion lines. If Uml is so great why is rational rose such a pos ?Where are the uml diagrams for .net or java ?
mP
+4  A: 

I use none.

I have hardly seen them since university times and my diploma projects.

Have an impression mainly students/profs are interested in these methodologies, the world of practice lives happily without UML.

While I'm not saying that UML can not bring any benefits.

User
So do you use anything instead?
Decio Lira
Nothing. I used to use PowerDesigner for DB modelling, but when SQL 2008 was out and there was no update for PD, I dropped it. Looks like neither I need anything for my private project nor the company where I work needs anything for our enterprise application.
User
I'm at the same boat. I use none. When I need some diagrams I draw something on paper without obeying UML or anything. Just some boxes and arrows connecting them the way I want to express at the moment
Edison Gustavo Muenz
Drawing diagrams using your "own personal UML style" might be okay if you only need them yourself. But if you work in a big team and you have to do some design specification in a way that it will be understood even in a few years (when you probably do not join the team anymore) UML is the choice!
koschi
+1  A: 

I use class diagrams quite often to document the high-level design and relationships between the most important classes. I often use state-transition diagrams, but not done in UML style. I rarely use sequence diagrams, finding them difficult to read (and write).

Jeff Kotula
+1  A: 

They can all be used for design and documentation of a project. This is very open to interpretation.

It is going to depend on the project and who you are creating the documentation for. In some cases UML is next to useless, but can help you build a simpler non-UML diagram that end users can understand.

At other times when you are just documenting for other software developers UML diagrams can be useful. In this case, state transition diagrams might be useful for systems developers whilst use case diagrams may be better for analysts documenting requirements.

Overall using UML for the sake of it is not helpful for other programmers, users, or your customers. It's only one tool for communication. If you get too religious with your UML usage you are not servicing the needs of any of these groups.

BrianLy
A: 

I work in an agile environment, so most of the UML I write is short-lived drawings on a whiteboard.

I use class diagrams for illustrating how classes relate to one another. I use activity diagrams instead of traditional flowcharts to explain general program flow. State machine diagrams can be useful to explain state changes in object lifecycles. Very occasionally, I'll use a sequence diagram to work through some tangled program logic, though I'll often refactor the code to gain that understanding.

neontapir
+1  A: 

I don't like use case diagrams. The diagram doesn't really show much, I find a bulletted list with descriptions to be much more useful, if not full use case descriptions with scenarios, failure conditions, etc.

Class diagrams are useful, though I never really put all of the details into them. Getting the connections between the domain objects and how everything fits together seems to be more useful than going through and filling in the behaviors and fields.

Sequence diagrams are great if you're trying to figure out the flow of something that's getting a little too complicated and you're having trouble visualizing what is going on.

Class diagrams, sequence diagrams, and state diagrams are also great for trying to figure out what existing code is doing.

I don't worry about formalities in my diagrams; they're rough sketches on a whiteboard.

Adam Jaskiewicz
+1  A: 

Use-Case diagrams do not provide any detail, but I haven't seen a better way to quickly give an overview of all the use-cases in the system.

Class diagrams are useful for showing the classes that are part of each package. However, I seldom see them used for that purpose by other developers. They are usually used to throw a bunch of classes on a picture with little rhyme and reason as to why the particular classes are in each picture. Thus, the diagrams end up not being very useful.

Sequence diagrams are indispensable. The tools absolutely do not support useful usage of sequence diagrams so you have to be somewhat inventive within the limitations of the tools. But I use sequence diagrams to prove that my use-cases match my architecture and my design matches my package operations etc... I don't think there is a more useful diagram. However, most people don't use them, probably because it forces you to think about your design.

The concept of the component diagram is useful. The UML version is pretty ugly, so I usually end up drawing my own diagram using Powerpoint or Visio.

I'm not much of a fan of state or activity diagrams. I had some bad experiences with other people's state machine designs early in my career and thus avoid them like the plague.

When it comes to presenting to a customer/manager then I use the information from these diagrams but I put it in a format that is easier to understand and at a much higher level.

However, for presenting to other software developers then these diagrams should be sufficient to convey the required information through design. But, usually they do require some narrative text be written in order to be of value.

Dunk
A: 

Ask yourself what do my users understand, am I truely able and committed to keeping my diagrams current and accurate or will they rot and add confusion...

mP
A: 

Ask yourself does .Net or Java deliver UML anywhere as part of its documentation bundle ?

mP
A: 

I only use Use Case diagram and deployment diagram only as I find them useful in explaining the functionality and deployment setup respectively.

Bhushan
+1  A: 

A domain model is indispensable in most projects. It gives the technical staff a consistent, clear and unambiguous understanding of the domain vocabulary. A UML class diagram is the best notation for this (yes, even better than an English language glossary).

A use case model (that's model, not diagram) is much easier to manipulate than a dozen Word documents (depending on your choice of UML tool, of course) and so I'd recommend you follow the UML route in documenting your use cases. Your UML tool will almost certainly allow you to assign additional information to your use cases, such as test scripts, metrics etc. Having this in a model will allow you to create custom reports on this extra information.

Beyond that, I'd say that if you need a state diagram, use a UML state diagram; if you need a flow chart, use a UML activity diagram; if you need a call graph, use a UML sequence diagram. In each case, the UML notation is going to be more widely understood than whatever ad hoc notation you invent on your own.

But the general message is, to use whatever tools you have at hand to make your job easier.

chimp
A: 

My personal vote: Use Case Diagrams Sequence Diagrams Class Diagrams

with the occasional, supplemental Activity Diagram.

But I think mileage varies. I typically work on systems with lots of use cases, some of which are served by integrating commercial solutions and writing a little bit of code. So for me, use cases are often the most relevant part of UML, with an occasional component diagram.

Sequence and Class have been the defacto diagrams for software design, but I've seen them be used very poorly. It's easy to fall into a pattern of designing cookie cutter diagrams with these, and not really drilling into a diagram that shows the really critical design aspects of the system.

I love UML for it's ability to provide a clear, standardized syntax for explaining design problems in a consistent way. But I hate that sometimes its considered a development "standard" and not just one tool for the job. I say use them if they help to enlighten a critical group of people and skip them entirely if they serve now useful purpose for making a technical decision.

bethlakshmi
A: 

Sequence diagrams to help me keep track of things when I try to grok other people's code.

fakeleft