Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming Software IT Technology

How Do You Use UML? 219

christophe.vg asks: "We are currently investigating the feasibility of a new (open source) project and part of this study involves a scope definition of how people/developers currently actually use UML. So there it is: How do you use UML? Do you use it to have nice class diagrams to pin up to the wall so you/it just looks great or do you first model out every little detail into class and sequence diagrams before generating or writing even one line of code? Now for a moment, let's dream the UML dream. Do you think that in the future one could maybe even envisage software development where UML could simply replace all existing coding languages? One could argue that coding languages are merely formatting tools to implement the actual logic, which can be portrayed 'in a Unified way' using UML schemas. What are your ideas regarding the real merits of UML, currently and in the not so distant future?"
This discussion has been archived. No new comments can be posted.

How Do You Use UML?

Comments Filter:
  • Code first... (Score:4, Insightful)

    by DrJonesAC2 ( 652108 ) on Sunday January 02, 2005 @01:36PM (#11239037)
    ...documentation afterwards. That's logic!
    • Insightful (Score:5, Insightful)

      by RAMMS+EIN ( 578166 ) on Sunday January 02, 2005 @02:15PM (#11239227) Homepage Journal
      At least somebody should mod parent Insightful. You can't fully design your program in advance, because you're always going to run into issues, and because the requirements will be different when the implementation is done.

      This is exactly the trap most UML users fall into, which is why I avoid UML like the plague. Design and document as you code. Hardly any project is ever finished, and the design and documentation shouldn't pretend otherwise.
      • Re:Insightful (Score:5, Insightful)

        by M1FCJ ( 586251 ) on Sunday January 02, 2005 @03:10PM (#11239484) Homepage
        You might not like it but XP methodology recommends you design first, design the unit test first, then code. This doesn't mean you are not going to change your design but at least you should start with something in your mind. UML is just a tool, if you don't need it, don't use it. Most programmers are not that good at writing code as it goes.

        Documenting code? Hah! :-)

      • This is exactly the trap most UML users fall into

        UML is a notation system, not a methodology. The original poster is basically asking what methodology do /.ers subscribe to in their use of UML.

        Here is an example. The RUP methodology prosribes that UML documents are living, iterative, and incremental. They are living in that you go back and update the UML diagram when you discover a change in the design while coding the classes. They are iterative and incremental in that you start a diagram with a focus

      • Re:Insightful (Score:3, Insightful)

        by GlassHeart ( 579618 )
        This is exactly the trap most UML users fall into, which is why I avoid UML like the plague. Design and document as you code.

        Just because design cannot fully predict every detail and requirement change doesn't mean that the opposite extreme is better. The problem with your suggestion is that when working in a team, there are design changes that you simply cannot make without breaking somebody else's code and assumptions. So clearly, design cannot be entirely static after some "begin coding" day, nor can

    • Re:Code first... (Score:2, Interesting)

      UML is best used for informally descussing the design of existing/proposed code. Alternatively it could be used to document existing code.
    • UML diagrams is what we create to get ready for PDRs and CDRs. It's all fluff. I generally create a mental picture and jot down some notes of process flow and use cases before I start coding. Sometimes I use UML class diagrams to create my classes but since Eclipse is so easy to use I find myself doing this less and less.
    • UML should be used to DESIGN your programs. After all it's "Unified *MODELLING* Language", not "Unified nifty diagrams documenting language".

      Lack of previous (even on-paper) design is what makes programs buggy. When you code first, doing the UML diagrams is useless. Why? Because when you find out the structure of your code and see possible improvements, you realize that it's too late to make any changes, due to compatibility problems, etc etc etc.

      Look at what happened to the Lazarus project [freepascal.org]. it's been on "pre-beta" for more than 6 years, and they 're still telling me it's too early to make an UML diagram because "the structures change too much". (WTF?!?!? If I want to cooperate in a project, the least i can ask for is the UML diagrams so i can focus on where to help, not navigate among the millions of lines of code!)

      Follow my advise. Design first, code afterwards.
  • by macz ( 797860 ) on Sunday January 02, 2005 @01:39PM (#11239051)
    There is too much fungibility in expression. I am noticing a trend to standardize on things in languages that is interesting. For instance, there appears to be a trend towards recognizing the differnece between the "assign" operator (=)and the "equality" operator (==). Most (useful) languages use the ! to negate... perhaps we are heading towards a unified syntax at least?

    Wouldn't Parrot, or similar approaches that let you code in whatever idiom you feel most expressive in, while compiling down to efficient, cross platform bytecode be the pentultimate achievement? You could add a module for UML and let those crazy Visio programmers write what they wanted while leaving the C Programmers alone?

    • by RAMMS+EIN ( 578166 ) on Sunday January 02, 2005 @01:57PM (#11239142) Homepage Journal
      ``Wouldn't Parrot, or similar approaches that let you code in whatever idiom you feel most expressive in, while compiling down to efficient, cross platform bytecode be the pentultimate achievement? You could add a module for UML and let those crazy Visio programmers write what they wanted while leaving the C Programmers alone?''

      Wouldn't really work. There's more to a language than syntax alone. Languages have fundamentally different ways of representing things. Think static vs. dynamic, classes vs. prototypes, objects vs. primitive types, first-class functions, tail call elimination, overloading, ...

      In the context of Parrot, problems are already arising from the way Perl and Python deal with things. We know from history how well calling conventions are adhered to...basically, C and assembly use one, C++ uses a bastardized variant, and beyond there, chaos reigns.

      Microsoft is on the right track with .NET, actually trying to adapt their CLR to languages it wasn't originally intended for, rather than the other way around. Yet, not even all of Microsoft's own languages for .NET adhere to all the specifications for interoperability.
      • We know from history how well calling conventions are adhered to

        They are adhered to very well when provided at the operation system level very poorly when left as an option. VMS being a great example where calling conventions and complex datastructures are defined at the OS level. The result is that a C function is callable in Cobol, VAX Basic, Fortran... and vice versa.
    • "Wouldn't Parrot, or similar approaches that let you code in whatever idiom you feel most expressive in, while compiling down to efficient, cross platform bytecode be the pentultimate achievement? You could add a module for UML and let those crazy Visio programmers write what they wanted while leaving the C Programmers alone?"
      That would be bad. A companies depend on software and some type of control must be set up. Standards for languages, documentation, and even how the source code is stored. You never kno
  • UML-ish (Score:3, Interesting)

    by rmull ( 26174 ) on Sunday January 02, 2005 @01:40PM (#11239054) Homepage
    UML is a language, not so different from C or Java. It's good at representing some things, like structure relationships and certian kinds of high-level sequencing. It's not so good at others, like complicated data stuctures or calculations. It would be silly to write a memory manager in UML.

    I use a bastardized form of UML on the whiteboard when I need it. It's not in any way official, just enough to get the point across. I occasionally will put that on the computer using visio, but again without much regard for form. I'm not one to think in UML itself, so all of the modeling tools that are designed around it tend to slow me down more than anything.

    I'm perfectly happy with my way of doing it, but maybe I just haven't seen the light. Could be that a few weeks of Rational "training" would reverese my opinions entirely. ;-)
    • Re:UML-ish (Score:4, Insightful)

      by kinema ( 630983 ) on Sunday January 02, 2005 @03:20PM (#11239524)
      It would be silly to write a memory manager in UML.
      UML was never meant to be used for describing things like a memory manager. Algorithm design and development tools such as Matlab [mathworks.com] and Simulink [mathworks.com] are much more suited to this kind of task.
    • I use a bastardized form of UML on the whiteboard when I need it. It's not in any way official, just enough to get the point across...

      I'm perfectly happy with my way of doing it, but maybe I just haven't seen the light.

      You're not alone here. Sounds like you're close to 'UML as Sketch' [slashdot.org] as touched on in comments here [slashdot.org].

    • "It would be silly to write a memory manager in UML."

      You are just plain wrong. I've used UML to design and implement low level device drivers for embedded platform with C++ autogeneration. There's nothing in UML that causes it to produce bloaty code, and there's quite a lot of richness with the right tools (e.g. Rational ROSE) to customise the C++ code that's generated.

      This has nothing to do with UML, but has more to do with you as the designer: do you know how to design performance device drivers or not
      • Re:UML-ish (Score:3, Interesting)

        I quit using RationalRose around v 3. It was simply too buggy. In fact, that is my complaint with most of the UML tools that I have tried. So are the UML tool makers using UML to design their own tools? If no, then the shoemaker's kids are going barefoot. If yes, then the bugginess of the UML tools is an indictment of UML. If using UML to design a UML tool doesn't help reduce the bug count in the UML tool itself, then why should we bother to use UML on other projects?
  • Alphabet soup.... (Score:2, Informative)

    by jnik ( 1733 )
    Please folks, especially if you're doing an ask slashdot, try to either expand your TLA's early on or make them clear from early context. Until I got to the end of the blurb I thought this was about user mode linux...and now, of course, I have no idea what it is. Background links welcome.

    (this should answer the question of how I use UML...)
  • by RAMMS+EIN ( 578166 ) on Sunday January 02, 2005 @01:42PM (#11239065) Homepage Journal
    The way I use UML is as way to select projects I want to participate in. If it uses UML, I'm out. The correlation of using UML with rigid authoritarian organization and fighting with "productivity enhancers" rather than developing software is too high.

    It's a pity, because visualizing the structure of a program can be a Good Thing. Still, the idea behind UML isn't exactly new, and does not seem to be very successful historically.
    • by tom's a-cold ( 253195 ) on Sunday January 02, 2005 @04:47PM (#11239919) Homepage
      The way I use UML is as way to select projects I want to participate in. If it uses UML, I'm out. The correlation of using UML with rigid authoritarian organization and fighting with "productivity enhancers" rather than developing software is too high.
      I've done development for a very long time and there are few non-trivial projects where modeling, used correctly, doesn't reduce risk and end up delivering a higher-quality product. In fact, I won't hire any developer who refuses to use UML since I'll assume that s/he is lacking in essential software engineering skills and is a "code first, understand the problem later" sort of person. I've burned too many hours fixing that kind of code to ever want to do it again. And I'm about as far from an authoritarian manager as you can get.

      The art is to know how much modeling is enough. This depends on the development tools you're using (languages, IDE's), the problem you're trying to solve, and the skill level of the developers and "buyers" of the project. I find it most useful at a higher level of abstraction: activity diagrams are really good afor understanding business processes; a high-level object model is usually a good thing to have early in the project definition phase; and I always want a convincing story on object life cycles before we start: this probably involves realization and sequence diagrams.

      I seldom use more than 20% of the semantic richness of UML-- I use it more to "rough out" a description of objects and their behavior. Part of the reason for that is that there is no value in using UML to replicate capabilities that are already built into the development tool suite. And detailed modeling of stuff that doesn't matter is just bullshit. Anyone who documents every page on a website with a sequence diagram that basically tells you nothing should be taken out back and shot. Since I'm usually the tech lead on projects, I'm the one who tells the clients what we use and why. And if they expect some UML feature that we're not using, I tell them why we're saving them money by tailoring it out. If your management aren't capable fo doing that, they aren't fit for their jobs.

      My main point is that UML is a common language to make analysis and design more effective. It's only useful when it does that. Knowing when it's helping and when it gets in the way is a judgement call for which somebody had better be prepared to take responsibility. Unthinkingly doing everything everytime to insane levels of detail is nothing but a shameful waste of resources. It should be the yeast, not the flour, in your loaf of bread. It cannot take the place of intelligence.

      • I tend to agree in that modeling a program in a meaningful way is useful. As a general rule, when I start working on a project, after I have gotten the requirements, I begin breaking it into discrete sections (for example - gui, network, database, etc), and then break those sections into sections until the implementation is relatively trivial.

        By the time I'm finished with the rough model, I basically have a list of tools to make and fit together in order to create the finished program. Of course, this do
      • I think that this is one of the most insightful comments here.
      • I agree with much of your post, particularly these excerpts [emphasis added]:

        I've done development for a very long time and there are few non-trivial projects where modeling,

        used correctly, doesn't reduce risk and end up delivering a higher-quality product.

        The art is to know how much modeling is enough.

        And detailed modeling of stuff that doesn't matter is just bullshit.

        To answer the original question, I find aspects of UML useful in two places:

        1. While prototyping at the start of a new project, wh
    • Here here!

      It's not that there's anything fundamentally wrong with UML, but UML seems to be the lowest common denominator used when slinging around bullshit.

      Hey, if you don't want to learn how to program, but you want to tell a bunch of programmers what to do, learn how to draw squares with arrows off of them and tell those no good programmers what to do anyway!
    • by GoofyBoy ( 44399 ) on Sunday January 02, 2005 @05:53PM (#11240229) Journal
      >If it uses UML, I'm out.

      Its a communication tool. Thats all.

      Its like saying "If the business analyst wears a white shirt and tie, I'm out." or "If the specifications are in New Times font, I'm out."

      • "Its a communication tool. Thats all."

        I think you're wrong: it's a design tool as well (you could be pedantic and say that it this also makes it a communication tool, but come on!). Seriously, UML as an OOA/OOD helps you scope out and bound the size and complexity of the design, so you get a clearer idea of what kind of time/effort it'll take to realise, and what order of magnitude bugs/issues you'll have to deal with later.

        If you're only using UML as a communication tool, you're seriously underusing it.
        • >UML as an OOA/OOD helps you scope out and bound the size and complexity of the design, so you get a clearer idea of what kind of time/effort it'll take to realise, and what order of magnitude bugs/issues you'll have to deal with later.

          It doesn't to it by itself, like what an compiler does. It takes a person to read it an then extract this sort of information from a standarlized form. So UML is a communication tool.

          What does UML produces? Documentation, which is a communication tool.
  • What? (Score:3, Funny)

    by fm6 ( 162816 ) on Sunday January 02, 2005 @01:49PM (#11239103) Homepage Journal
    An "Ask Slashdot" that provokes an interesting discussion? That's not allowed! Are we all out of clueless lame-ass questions, or what?
  • by Will_Malverson ( 105796 ) on Sunday January 02, 2005 @01:59PM (#11239153) Journal
    In late 1998, I was working for a small company that decided to explore this new-fangled UML. A group of about 10 of us took a week-long course on it, and learned the basics of it. We decided, as a practice project, to re-implement one of our small subprojects with UML. We spent a few hours a week working on this.

    When I left the company in April of 1999, we had made no signfigicant progress on the project.
    • Well, I hate UML as much as the next guy, but a few hours a week is not the way to accomplish anything significant!

      If you put all those hours into x number of 10-hour days, on the other hand, you would certainly have accomplished more.

    • You admit that this was your first experience with UML, and by the sounds of iy, you didn't get it right. Can you blame UML, or can you say that it was because it was a first project and so on. Without knowing further details, I think your attitude is bad: you had one bad experience and have let it cloud your judgement for the future. Plenty of other people have good experience with UML, whether on first or subsequent attempts, which is testimony to the fact that it does work: but of course, UML is just one
  • Not so much (Score:3, Informative)

    by miu ( 626917 ) on Sunday January 02, 2005 @02:02PM (#11239169) Homepage Journal
    Most projects seem to wind up with some UML for the specifications and use cases, high level architecture diagram with no particular modeling language and UMLish whiteboard discussions between teams and individuals working on interfaces.

    The only time I see formal UML is when it is generated by a reverse engineer tool that spits out UML for what has actually been coded.

    If there were some actual useful UML tools I might use it a bit more, but as it stands I don't much care for any of the diagraming tools that are available.

    • Re:Not so much (Score:3, Interesting)

      by lphuberdeau ( 774176 )

      My major problem with UML actually is that the tools to design it are a pain to use. I never saw one that would feel as easy and natural to use as pen and paper is to draw structures. I do plan my structures, patterns, class names, responsibilities before starting to code, but I just hate using UML tools.

      Reverse engineering tools are nice because they are quick to use but the results are either too details or not precise enough. Relations are usually association, extend or implement. UML has a whole lot

      • I agree very much that good tools would make UML more valuable than it is right now, but I think there is also a fundamental problem that something too close to implementation is specified by UML as commonly used. When used in that manner the UML becomes nothing more than additional version of the code in a more abstract form, this is fine if the UML is generated from actual code, harmful if not.

        I guess the design tool that I would like to see would be a reverse engineering tool, UML use case tool, physi

      • I remember working on a project where we made the entire structure before writing a single line of code in UML. We made it all as a team and all agreed on it. The first guy to actually started codiing it totally ignored what we made. Great! We simply wasted time!

        Well, because at that point, unless your UML tool is going to spit out its own code, the poor sod who has to try and write code that matches an UML diagram is in for a very tedious job of defining and structuring in this way. Unless it's going to

      • "I remember working on a project where we made the entire structure before writing a single line of code in UML. We made it all as a team and all agreed on it. The first guy to actually started codiing it totally ignored what we made. Great! We simply wasted time! "

        That's not a problem with UML, but with your team: that guy sounds completely unprofessional -- i.e. he agreed to a consensus, and then ignored it, which could happen in any circumstance, not just because UML was there.

  • UML is useless (Score:5, Insightful)

    by Jerf ( 17166 ) on Sunday January 02, 2005 @02:10PM (#11239204) Journal
    UML is useless because it can largely not be meaningfully verified, kept up to date, or executed. As a communication language in the middle of a design session a simplified version of it has a place, but there's little point in trying to drive development with it.

    I can't point to a project that does everything UML tries, only it works, because state of the art has not advanced there yet, and anyone telling you otherwise is selling you something, be it software or an agenda.

    But I do know one thing that you must internalize: If it doesn't execute, automatically, it won't be kept up to date.

    The best thing I've found so far is a strong coding style that emphasizes readability above most everything else (none of this "np_doSCRTtrd" crap, give me "mainWindow" or something... even in C++ where this is strongly counterculture), comments for why the code is doing what it is doing, and unit tests to provide and verify specification compliance.

    Nope, that's not complete; it is difficult to borderline impossible to unit test everything. But this will take you far past anything UML can do reasonably, so it's a start. (I'm inclined to think the way forward is to make more things more testable; while unit tests have problems with multithreading even in theory, a lot of the practical problems one encounters comes from a lack of testability built into libraries. The canonical example of this is GUI libraries; there is no fundamental reason GUIs should be hard to test... if you could post events to simulate anything the user might do, that alone would nearly be enough, and you'd think this wouldn't be hard...) It's just the best I know, and, like I said, as far as I can see it handily defeats UML in every way that matters to me, so the fact that it doesn't fulfill the promises of UML doesn't bother me, especially as I'm not convinced anything can.
    • Re:UML is useless (Score:5, Interesting)

      by digitalyak ( 534504 ) on Sunday January 02, 2005 @05:24PM (#11240071)
      But I do know one thing that you must internalize: If it doesn't execute, automatically, it won't be kept up to date.

      I'm on a project that is using Executable and Translatable UML (xtUML) for developing embedded firmware. The target is an 8-bit microcontroller.

      Our software process involves doing an extensive requirements analysis phase. Next, we break the problem down into domains, which are further anaylyzed. Finally, we begin work on the class models and state models.

      The xtUML methodology includes precise semantics, which allow it to be directly translated into C using off-the-shelf compilers. Or, you can be brave and write your own model compiler to directly translate your models into the target assembly.

      There is some high-level action specification language code which is written for the state actions and instance based operations, but besides that, no coding is required.

      Check out this site for some xtUML information: http://www.projtech.com/ [projtech.com]

      • Bad mod of parent! (Score:3, Insightful)

        by BerntB ( 584621 )
        Parent was modded to 0.

        It would have been better if the modder had written a motivation why that product (and method) was bad.

        Anyone with answers?

      • Re:UML is useless (Score:2, Insightful)

        by obobo ( 18583 )
        That's a good point: state machines are often better expressed as diagrams than as code, and automatic translation of them into code is not terribly difficult. If your problem fits well into a state machine framework (some embedded work, network stack, etc) it can be very useful.

        While most people think of class hierarchy diagrams when they think of UML, but there are a bunch of other (unrelated, really) types of diagrams that are under the UML umbrella as well.
    • I think you are just plain wrong, and I've actually used UML on several projects: just out of curiosity, what kind of experience do you have to back up your claims, have you used UML on actual projects, or worked near/with teams that have, are are just spouting a lot of uninformed garbage? I would mod you down if I could.
  • Rarely (Score:5, Interesting)

    by Apreche ( 239272 ) on Sunday January 02, 2005 @02:31PM (#11239300) Homepage Journal
    I rarely use UML. Sometimes in class they force us to use it for things, even grade us on it. But its just a waste of time really. The problem is that some people use UML to layout the design for their application in full, or part, and then build the software following that design. But inevitably the design goes through a thousand changes. Most often a simple flow chart is quicker to make and more useful for this purpose.

    What UML IS good for is communication. If you have a software design and you want to communicate that design to someone else, then UML is a handy tool. It's also useful for division of labor. You can make UML for the project and divide up the pieces of the diagram each programmer has to do. But in this situation you're really just commicating the design to each other, which is all UML is really good for.

    The idea that one day we can just make UML and not have to code in C or something is ludicrous. If we move away from "real" coding it will definitely be to a much more abstract tool than UML which will write code for us. You can see it happening already like all the drek that Visual Studio comes with.
    • Most often a simple flow chart is quicker to make and more useful for this purpose.

      Then, all respect due, your projects are too simple. Flowcharts cannot represent state, communication between objects, threads, or a number of other entirely necessary concepts. A flowchart has trouble representing anything much more complex than a Unix-style command-line application.

      Also, if you find that a particular diagram or description style survives requirement changes better than another, it's likely because it wa

    • Re:Rarely (Score:4, Interesting)

      by angel'o'sphere ( 80593 ) <angelo.schneider@nOSpam.oomentor.de> on Tuesday January 04, 2005 @01:07AM (#11251725) Journal

      The idea that one day we can just make UML and not have to code in C or something is ludicrous. If we move away from "real" coding it will definitely be to a much more abstract tool than UML which will write code for us. You can see it happening already like all the drek that Visual Studio comes with.

      That day has allreay come.

      Read about UML/MDA and xtUML. Probably you should just search on sourceforge how many MDA tools exist TODAY.

      Not that am I a hughe friend of MDS ... but 'm a hughe friend of UML :D


      I rarely use UML. Sometimes in class they force us to use it for things, even grade us on it. But its just a waste of time really.


      So I asume you are still at the university? So you only make toy projects there which are done in 3 monthes and you do them as one person or two peson or three person team?

      Of course you then have the fealing you "do extra work".

      But no offence, I guess you have not long enough programming experiance? If you had, you had concepts in your mind which are difficult to talk about, but easy to sketch with UML.

      Did you ever make a project with 10 people (programmers) and about 5 other stakesholders over a period of 3 years? (Or more people and more years?)

      As soon as you have done that you know why you *need* UML.

      angel'o'sphere
  • UML as a Sketch (Score:2, Interesting)

    by Avalonia ( 169675 )
    At the company I worked for until very recently we mostly used 'UML as a sketch' on the whiteboard as a way of turning our ideas into something concrete we could implement. Simply having a standardized set of whiteboard notations hugely improved the effectiveness of communication between team members.

    We mostly used class and sequence diagrams, the latter being very effective for dealing with multithreaded code.

    To a much lesser extent we used computer generated UML when reverse-engineering with tools like
    • At the company I worked for until very recently we mostly used 'UML as a sketch' on the whiteboard as a way of turning our ideas into something concrete we could implement...

      I'd definitely have to strongly second this. I've seen this boil out from working at a few different companies. Those who used UML most strongly also seemed to gain less from it (and one architect seemed amazed and could not even fully grasped the concept that I'd been doing OO design for years without any UML at all... even when m

  • Emphasis on the word, try. Most of the time we end up doing it the old fashion way which is that when someone wants to illustrate a complex idea instead of using a neat little UML diagram that half the team will spend most of the meeting trying to figure out, we just draw it on a board with a marker. It's low tech, but it works.

    We unfortunately bought into the whole "Rational" line of products and they have turned out to be horrible. It's had many of us pining for CVS and bugzilla.
  • For discussion (Score:2, Interesting)

    by NateKid ( 44775 )
    When teaching coding classes, I usually use UML to demo basic object interactions and class structure on the blackboard. If I instead write a bunch of code I wind up receiving glazed looks from my students. It takes several days to teach the syntax of OO programming to students but I can have them drawing /comprehending rectangles in a matter of minutes.

    For my own programming projects, I usually use UML to code stuff up with pencil and paper on the bus and I then "translate" it to actual code once I get
  • by jhoger ( 519683 ) on Sunday January 02, 2005 @03:56PM (#11239687) Homepage
    It sounds like what you are really interested in is not UML but VPLs, Visual Programming Language (not to be confused with things like Visual Basic which is a fairly normal programming paradigm with some RAD gui development tools built in).

    Programming with boxes and wires is the way you code in such languages. Anyway google for visual programming language and you will find lots of stuff. The VPLs also allow you to draw your state machine for a component visually. This permits writing your entire application visually, as opposed to just connecting up components.

    I think one of these days we'll create all applications in this way. What could be better for an architect than having your entire application as a very clear, always up-to-date diagram, which can be zoomed in or out to get whatever level of implementation detail you like?
    • These have been around for quite some time... And generally they suck. Parity Software's (Now part of Intel) VOS is an example, and personally, I'd much rather just code.

      • I agree they have been around for a while, and most do suck.

        I think they could be better, and they have gotten better over time. LabView I think is a better example, with the ability to make components and state machines visually.

        The human brain is geared more towards processing of visual information than it is textual information. I think to reach our full potential as programmers that's where we need to go.

        Also I think having a visual representation of the design which is always up to date because it i
    • I've never tried any PC VPL, but I've had a go with Lego MindStorms (simple, I know) which use something like you describe. I found that it quickly becomes unmanagable, is hard to use, slow, and inflexible.

      When I say that, what I mean is, assembly would have been much easier than it. Which says enough I think.
      • Well I think that says something, but I don't think that is somehow a proof that research along this line is a dead-end. All it means is that none of the variants you've tried are a big success.

        There's no reason that VPL should be hard to use, slow or inflexible. There are certainly implementations that are.

        It's a young field of study that hasn't got much attention, and I don't think there's any fundamental flaw in the concept, just some fledgling attempts.

        • Well, some of the problems I have had are
          • I have to explicitly define the order that commands are done in
          • If I want to remove a command, I need to then connect the commands around it
          • It isn't as easy to add an operation in the middle of somewhere
          • I have to a) find the operation I need in some huge list, or b) navigate several layers of menus for each function
  • Control Problems (Score:2, Interesting)

    by gokeln ( 601584 )
    I write a lot of device-control kinds of applications. The high-speed stuff (> 1kHz) benefits tremendously from hierarchical state machines. I began using the mechanism Miro Samek proposed in "Practical Statecharts in C/C++". See http://www.quantum-leaps.com/ [quantum-leaps.com].

    This is a very nice framework for taking your statecharts directly into code. They are also pretty efficient.

    However, in a couple of cases, I had to abandon his framework, because the DSP implementation ended up being too big to fit into my DS
  • UML Fever (Score:5, Interesting)

    by danpat ( 119101 ) on Sunday January 02, 2005 @04:16PM (#11239792) Homepage
    Death by UML Fever [acmqueue.com]

    That's a very interesting take on some specific issues one often comes across when trying to use UML.

    Personal experience has shown that some of the features of UML are useful. We often use class diagrams to help new developers on the project get quickly up to speed. The class relationship information, which is what they need, is more densely represented in UML than as code. That said, we rarely use most of the other artefacts. Pseudocode and flowcharts often seem to work much better.

    When it comes down to it, UML is sometimes a useful communication tool, but that's about the extent of it. When you have a bunch of developers who communicate better in some other way, you use that instead.

  • Use Cases (Score:3, Interesting)

    by YourPreferredNicknam ( 168221 ) on Sunday January 02, 2005 @04:40PM (#11239893)
    All my collegues at work diss UML - but then again they didn't have to take it in school. I do use cases for myself quietly on the side. Use cases I like because: 1. they capture requirements well 2. they can read like a test plan of sorts.

    The other parts of UML I do not find so useful. I mean, I could just use regular flowcharts, state tables, or class declarations instead of the UMLized equivalent.

    UML is just a way to describe your software requirements and design. Heck, you can even use regular English prose if you like, just like the good old days.

  • dumb question (Score:2, Interesting)

    by zogger ( 617870 )
    dumb question but because I am not a developer I'll ask anyway. I am seeing the comments on "code commenting". Aren't there any editors that automagically generate at least some sort of generic commentary as you code along? I guess I assumed this was the case already. I know specific things you'd have to type in, I just though a lot of the general stuff just got "done" as you typed in code according to what language you were using, etc.

    anyway.. where is the speech to code to useable apps dealie? heh, that'
    • Well, the traditional answer is "If it was hard to write it should be hard to understand".

      The code tells you everything you need to know AND has the virtue of actually being what the computer will do. Comments are there for the tricky sections and to give a high level overview of what is happening or the "why" of what is happening, rather than the "how".

      The problem that you typically have when reading code isn't figuring out what each line is doing, but building up the mental overview of how all the
  • by schmaltz ( 70977 ) on Sunday January 02, 2005 @06:03PM (#11240282)
    I use UML to design and document apps I write, when it's helpful. Usually for apps it takes longer than an eight hour day to write, and will see change in the future. It provides a birds-eye view of what the app is doing, and how it represents data.

    How many open source projects do you see that come bundled with documentation cleary explaining how its internal structures look and relate, and how the program was intended to behave? If you answered "Few to None", you'd be today's winner! Monty, tell 'em what they've won!

    UML is a visual modeling *language* used to communicate program behavior and data structure concepts with others (mostly humans), typically in an object-oriented context. As a bonus, there are quite a few visual modeling tools [objectsbydesign.com] that work with UML. Some emit corresponding code in Java, Python, C++ and a handful of other languages. Some are OSS/FS, while others are proprietary and pricey.

    UML is also handy when weaving Design Patterns into your application framework. If you're into designing your applications before you code them, you probably know about Design Patterns [hillside.net] and the GoF book [amazon.com]. Design Patterns are another kind of *language* for communicating about structure and behavior.

    I'm not saying the only way to design an app is with DP and UML, but together they are very effective at communicating data structures, how objects/structures are to be constructed, and program behavior. Which, not coincidentally, are the three main categories of code patterns described in the GoF book.

    The main point of UML is clear communication; for DP it's creating solid designs. To create an application that works well (does what's intended, doesn't need refactoring/rewriting when new data formats or behaviors are expected in the future), and is easy for other programmers to pick up (program logic easily understood, relationships between classes and other structures easily identified and grokked), it is good to choose a common language to communicate those things, besides the one the app is written in.

    For the folks who pedantically attack UML as being part or product of an authoritarian regime - well, it's just a tool that helps you get your job done, and communicate effectively with others. Sometimes it will get used by hardliners I suppose. The flip side to that is, are you communicating clearly and consistently?

    Maybe that doesn't matter to you, but maybe also you would be better off for expanding your personal toolset, and making yourself better understood.
  • by Tablizer ( 95088 )
    There is a conflict over territory in what UML and ER (entity-relationship) diagrams dipict. Where they don't overlap is behavior, but UML tends to assume that the relationship between entities and behaviors is one-to-one when actually it is not. My development philosophy is more or less to decouple, or at least not hard-wire at a high level, what entities are used to carry out a specific task. The relationships between entities and tasks is often fluid and not one-to-one, so I see little use in hard-wiring
  • by kimanaw ( 795600 ) on Sunday January 02, 2005 @07:28PM (#11240782)
    My first exposure to formal UML was in '96. Took a (employer-sponsored) class, and realized I'd been doing UML already using some newfangled tech called "pencil and paper".

    A few years later, I did some work for a major aerospace concern that had brought in an army of UML consultants to completely re-org the way they built their flying machines. They had literally wallpapered an entire floor of an office building with UML diagrams. Needless to say, nothing ever came of their delightful illustrations (other than relieving the corporate coffers of much coin).

    UML has unfortunately become an industry with lots of fancy GUI tools to draw pretty pictures, purporting to magically generate code from committee meetings. Just the sort of thing that keeps PHB's in corner offices, at least until the customer asks to see the working final product.

    UML is good as a starting point; it provides a lingua franca to flesh out requirements, and to communicate those requirements to implementors (I'm esp. fond of use case scenarios). However, it doesn't translate well to the often chaotic world of actual implementation, where performance issues, platform specifics, breakneck delivery schedules, and changing/creeping requirements usually crush the elaborate UML blueprints.

    UML is a discipline, rather than a technology. Properly used, it will likely improve your ability ro deliver what the customer wanted. Just don't fall into the trap of assuming its a magic wand that will make the hard parts of implementation disappear.

  • by occamboy ( 583175 ) on Sunday January 02, 2005 @09:17PM (#11241250)
    Sad to say, the only fellow I know who is actually gung-ho on UML writes scary code that easily breaks.

    The following may seem facetious (sp?), but I'm genuinely curious: does anyone have a story involving UML with a happy ending, along the lines of "Wow, if it weren't for UML we'd have been in big trouble?"
    • Fantastic experience with UML, Rational ROSE and C++ code generation: not only more productive, but the resulting design is far better because you're easily able to refactor while you're fleshing out the design. Typically, I've found, that once C++ implementation is underway, refactoring is hard and costly because of the amount of changes that need to be made, and the biggest issue for long term C++ code is the lack of design evolution, leading to code that has a lot of implementation hacks and quirks that
  • After I use UML, I wash my hands. That whiteboard marker ink is messy.
  • by OldAndSlow ( 528779 ) on Sunday January 02, 2005 @11:54PM (#11241993)
    There are several issues that are all being referred to as "UML."

    There is the model driven architecture (MDA) issue (that isn't being talked about here much).

    There is the waterfall vs. agile vs. sloppy issue.

    There is the authoritarian martinet boss vs. childish coder run amok issue.

    The "the tools suck so UML sucks" issue.

    And finally, there is the "It sucks so I'll never use it" vs. "Use the right tool for the job" issue.

    MDA first. UML is only the first part of OMG.org's attempt to revolutionize software engineering. I find MDA silly beyond words, and so I will not do it justice. Go visit OMG if you are interested in their side. The MDA folks want to be able to build universal models that get reused, transformed to fit domains, manipulated by tools to do all manner of wonderous things. I personally think they are having wet dreams, but it would be great if they could pull it off. That said, if you fully drink the OMG kool aid, you wind up thinking that all we need is a few high priests of models and really smart tools. right.

    As for the lifecycle issues, all of us who have been on more that one project know that the waterfall doesn't work; the "let's just write stream-of-consciousness code and screw everything else" doesn't work; and XP requires especially disciplined troops to make it work at all and then only or relatively small projects.
    What is also clear to anybody who has ever done maintenace, is that unless your code will never be used by anybody but you or it is small enough and well enough written to be understood by a complete noob before lunch the first day he looks at it, it is unprofessional not to document your design. It is also stupid to tackle anything but the tiniest projects without a design (and I count XP's emergent design as a design). So what are you going to use to express your design? How about the notation that all the books about software now use -- UML?

    I have worked for more authoritarian bosses than I care to remember. But I have also worked with too many nightmare developers who either simply didn't know what they were doing, had emotional problems, or were just jerks. This has nothing to do with UML, these same types were poinioning the same wells in the days of FORTRAN.

    Tools. The three amigos are the worst possible thing that could have happened to UML. They all work for Rational, so bosses think that Rational must have the best tools. **gag** Go look at Magic Draw, or Together, or Embarcadero Describe. I've had reasonable luck with all three. BTW, the three amigos are also behind MDA. I haven't been paying close attention to UML 2, but it seems to me they are making UML less useful for real work to make it more friendly to MDA.

    Sometime UML does suck for a particular job, or a particular implementation of UML sucks. That doesn't mean that is should be forever foresworn. It is a good tool for some tasks. Use it for those tasks. If the boss is so stupid as to think that the teams' best guess at a design at the start of the project should be cast in stone, then it is immaterial how you express your design, cuz you are screwed no matter what. (but don't be so silly as to neglect doing any design just to spite a stupid boss)

  • I'm a computer engineering student and for that they make us take some comp sci courses. In comp sci 2 and especially 3, they stressed UML very much. For each large assignment, we had to do class, state, and relationship diagrams. I'm torn if it was a waste of time. On one hand, it wasn't difficult and it was a good way to get an idea of how to start the program. On the other hand, we were learning UML as we were learning C++ so we'd end up changing so much when coding that it wasn't much use afterword
  • I never jump straight into coding, unless it's a trivial write-once program that'll take an hour or less. I design everything non-trivial ahead of time. I draw a lot of diagrams and write a lot of psuedocode. It may at times have strong resemblance to UML, but only because UML incorporates many (but not all) useful design methods. I'm not the kind to jump on every bandwagon that comes around. I have so much reusable framework code written and thoroughly tested, simplifying the implementation, that I can rap
  • by jbolden ( 176878 ) on Monday January 03, 2005 @02:54AM (#11242688) Homepage
    Here is my $.,02 for what's it worth.

    If the following sorts of things apply to your project the you are good candidate for UML:

    1) I would gladly triple the costs in exchange for halving the number of bugs
    2) There is almost no value in having the project complete early. On the other hand we need virtual certainty of meeting the conservative deadline we generating in the planning stage of the project.
    3) The costs of the software are overwhelmed by the costs of XYZ (where XYZ = marketing the software, getting it certified, the cost of how it gets used...)
    4) The cost of a serious bug is a large percentage of the cost of the project
    5) At the higher levels of the project we need to budget in terms of dozens/hundreds of man years for completion. Traits of individual developers are irrelevant
    6) No piece of code gets into a build without passing through at least 6 different stages involving independent or mostly independent groups
    7) We already have a highly controlled environment but the size of our projects is simply overwhelming the abilities of the dedicated (build, analysis, code control..) staff to understand what is going on.

    Conversely if the following apply it won't work out:

    1) We are under a tight deadline
    2) Individual programers have a feeling of ownership about their sections of the code
    3) Management is highly cost conscious
    4) While no one likes bugs its hard to imagine any single bug which is likely to get through would be serious enough to warrant increasing the total cost of the project by 10%.
    5) We have kind of a loose environment and we are hoping that UML help us to tighten up a bit.
  • I think that every engineer at one point or another has made it to the whiteboard to scribble some circles and arrows. Any standard which enables me to just begin drawing and know that my coworkers will understand my notation (does that arrow mean A extends B, or A sends a message to B?) is a good thing.

    However, UML as a whole involves a much, much bigger business scope, and that can be a nightmare. I was once part of a project that had one person in charge of keeping the use case document up to date. It

  • A lot of people here mentioned wanting a product where modifying the UML modifies the application. But what about the other way around?

    Does anything out there generate UML (or similar representations) from actual code-paths chosen by the application when it executes?

    (How would this be done? Perhaps using a specially instrumented runtime environment/JVM/glibc etc...)

    A product with both functionalities would offer design round tripping.
  • I'll occasionally diagram ideas when thinking about how to implement something or design an API, or sometimes in documentation. Dia [gnome.org] has some nice looking boxes in a category called "UML" which I use sometimes. Also, Doxygen [doxygen.org] can generate collaboration diagrams that look like UML diagrams. Mainly I just need some boxes and arrows. All that other stuff is not that useful.

    Maybe it's useful to autogenerate IDL or someting, but I've always found that to be a completely broken concept entirely.

    Reed

  • I see a reasonable number of useless comments from people that haven't used OOA/OOD language, but like to suggest their hypothetical ideas about the problems.

    Having used UML, I've found that UML itself per-se isn't the most importnat thing, what was really the killer was Rational ROSE with UML and code-generation. The reasons are:

    (a) the first pass UML diagram in Rose helped establish the "rough" design model: a pretty close OO diagram to help estimate complexity and amount of time for implementation.

    (b)
  • As Scotty would say, "Sse the right tool for the job." But that's only half the story. You also have to use the right tool in the right way. Too many people are using UML inappropriately. This is partly the fault of clueless managers, but mainly it's the fault of arrogant programmers.

    UML is not a code-generation language. Even though many tools have this as an option, don't use it. Just don't go there. In fact, stop using Rational Rose and Argo and start using Visio and/or Dia instead.

    If you're diagramm

  • When I think of UML diagramming, I think of the old-school Object Oriented Design approaches to client-server development and how it used to be fassionable to pay a close to a dozen high-rate contractors to philsoophize on the merits of alternate approaches to object design. Back in those days, cost was not an issue and every company thought they had the edge since they had all the OO visionaries huddled together in their conference room. Of course, things have changed and companies don't want to just blo
  • by UML Commando ( 845938 ) on Monday January 03, 2005 @03:50PM (#11247853)
    I have just submitted a sequel to the Death by UML Fever [acmqueue.com] article that appeared in the March 2004 ACM Queue magazine. It is scheduled to be published in March 2005. Beyond describing the Fevers which were the focus of the original "Death" article, the new article further elaborates on its symptoms, describes things people with UML Fever say, and introduces a 12 Step Recovery program complete with a "UML Serenity Prayer". It is quite clear, however, that UML Fever does not exist in this audience so you can read it for a good laugh.

    The tragedy here is that the big marketing machines have brainwashed the gullible, desperate, and ignorant into believing that UML is a silver bullet. As a result, diagram making robots are often directed to generate their beautiful models for unknown stakeholders and with unknown value to create the illusion of progress (Gravitational Fever: Afflictees measure progress by the weight of their UML diagrams).This is just one scenario of many that gives the UML a black eye.

    Let's face it, any tool can be misused and abused. People need to learn to use the UML where it is valuable to do so, at the proper level of detail, and with appropriate completeness. When used under the proper adult supervision, the UML truly can be a valuable communication and visualization tool with which to improve productivity as opposed to killing it.

    Is Death by MDA Fever around the bend?

  • Use UML like this (Score:3, Insightful)

    by angel'o'sphere ( 80593 ) <angelo.schneider@nOSpam.oomentor.de> on Tuesday January 04, 2005 @01:39AM (#11251814) Journal
    Start with Use Case diagrams, Activity diagrams and Component Diagrams.

    The order is arbitrary (depending on your knowledge about the future system and your UML skills).

    The goal is to have -- before you code:
    a) Use Case diagrams which roughly capture what kind of actions the users can do with your software.
    b) Components (either planned libraries/dlls or database tables or executeables or configuration files or just imagined "partitions" of one big executeable) where every use case is assigned to a component. That means the business logic for that usecase will later be in that "partition" of code. It makes sense to divide the components up into business components, data access and communication components and gui components (usually a use case is then realized as logic in the business component and also in a gui component for interaction)
    c) Activity diagrams for the complex use cases describing their controll flow.

    If you do not do a), b) c) above you can not write big systems anyway (except you have 20% factor 10 coders (The Mythical Man Month))

    After that is done you pick one use case or two, depending on team size, make the class diagrams for it, generate the code for them and fill out the empty methods with your code.

    If you have "scenarios" (that are user acceptance test cases) or XP user stories, make sure they conform with the activity diagrams and make a sequence diagrams as needed for them. That helps in finding the needed methods for you classes.

    Use a tool that supports round trip engineering so you can import that code back into your model. So the "private" methods you "invented" during coding get pulled into the model.

    Write your unit tests (better user acceptance tests based on the activity diagrams) and import those also into the model.

    When needed generate the SQL statements to create the DB tables and/or the DB access components.

    Is your application a protocoll driven, e.g. communication, robotics or persistance heavy, you probably might need state diagrams. A state diagram usually refers to a single class or a few connected classes.

    Here is a easy tool for UML sketching, it is not usefull for codegeneration etc. but toi get the first ideas how to use UML its probably the most simple one: http://qse.ifs.tuwien.ac.at/~auer/umlet/index.html [tuwien.ac.at]

    angel'o'sphere
  • by erinacht ( 592019 ) on Tuesday January 04, 2005 @07:18AM (#11252580) Homepage
    For me, UML is for expressing requirements - you are not designing your program in advance - you are expressing in a formal way what you want the program to achieve in advance - if your requirements are non-complex and you can accept escalation (scope-creep) then go ahead and use rule of thumb, works fine for lots of people, but for managing huge projects, the problems rarely lie but rather in the expression of requirements. Even for a simple project, interconnected use cases with pre and post conditions is a far better than english prose. It also gives you a nice mental model to hang the code off to make sure that you are solving the right problem. For more complex behaviour UML Activity Diagrams help greatly, the combination of use case and activity diagram creates an excellent way to decompose behaviour. Adding class models with constraints goes even further defining data and rules that give a head start into the development. The rule is to capture the essence. That requirements will change is a given fact of life, but with an MDA approach, the impact of those changes have a better chance of being managed and costed properly. Best thing is that once you have completed the requirements model, you have a re-usable system description. Since technology changes are v. expensive re-inplementations of existing functionality on a new platform, the base requirements in a non machine/language specific form are worth real and serious money to your company. Leave development for the developers (or in XP, RAD or @home, for when you don your developer's hat). Use UML to express requirements and let the programmers work out the best implementation with current tools and tech. - that's what they're paid for. This is the fundamental approach of MDA (model driven Architecture) - though I reckon the OMG's MDA approach might go a little too far down the RTE (round trip engineering) path to give truly useful expression of requirements. So the UML models tied with a good requirements system (we're using Telelogic DOORS - there are many others, but DOORS came out top for our needs) now, back to modelling the requirements for a requirements system - talk about fead huck...

The herd instinct among economists makes sheep look like independent thinkers.

Working...