Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Given that UML is oriented towards a more classic approach to object orientation, is it still usable in a reliable way to design javascript systems?

One specific problem that I can see is that class diagrams are, in fact, a structural view of the system, and javascript is more behaviour driven, how can you deal with it?

Please, keep in mind that I'm not talking abot the real world domain here, It's a model for the solution that I'm trying to achieve.

share|improve this question
3  
Many of us would say UML are not adequate to design really anything. I'm of the opinion the only value whatsoever in the whole canon of UML is the sequence diagram. Every other UML diagram I have tried to understand has been better explained in english. But that's subjective for what it is. –  Jimmy Hoffa Sep 15 '12 at 2:43
    
@JimmyHoffa I agree to a considerable extent. Especially with modern IDE's, a programmer should easily be able to look at object-oriented source code and obtain the same information (and more) that is depicted in a class diagram. I can imagine class diagrams being more useful before modern IDE's with syntax highlighting and auto-generated outlines were available. Class diagrams may be suited for depicting object-oriented structures to people without programming experience or in a large project where there is not enough time for the developer to verbally explain the design to everyone. –  David Kaczynski Sep 15 '12 at 12:19
1  
@JimmyHoffa Would you please recommend some good books or resources on systems modeled using sequence diagrams specifically? I read Applying UML and Patterns and it provided really good examples form using UML practically instead of just explaining the diagrams and syntax. –  Songo Sep 15 '12 at 16:51
    
@JimmyHoffa: I agree to you almost, but not about sequence diagrams - because IMHO sequence diagram show nothing what cannot be better expressed with pseudo-code. The only diagram type which has real use for me are data-flow diagrams, and those are not part of UML. –  Doc Brown Sep 16 '12 at 21:05
    
@DocBrown fair enough, let's just agree that learning UML should be avoided and rather a reading of the strunk & white should replace it perhaps :) –  Jimmy Hoffa Sep 16 '12 at 21:07
add comment

4 Answers 4

up vote 8 down vote accepted

It sounds like you're asking two different things

  • Can UML be utilized to depict javascript systems?
  • Can class diagrams be utilized to depict javascript systems?

Keep in mind that UML includes many types of diagrams, specifically a branch of behavior diagrams, including sequence and use case diagrams. Such diagrams specifically address your concern of modeling javascript as a behavior driven language.

It is quite possible that a javascript system is not using object-oriented design. In such a case, class diagrams would probably not be appropriate, as you pointed out. However, since javascript does support object-oriented design, it is possible for class diagrams to effectively depict a system using javascript. It really depends on how the javascript is being used.

share|improve this answer
add comment

It seems that you can use UML for JavaScript, but it will depend on how you are going to approach your work.

Specifically JS/UML can automate UML documentation for JSDoc, Dojo, YUI.

I would guess that there's more out there but didn't run across anything else yet.

share|improve this answer
    
how does this answer the question asked? –  gnat May 7 '13 at 9:06
add comment

Your answer is hidden in your question:

One specific problem that I can see is that class diagrams are, in fact, a structural view of the system, and javascript is more behaviour driven, how can you deal with it?

Look at BDD (Behavior-driven development) techniques and choose tools that suit your design needs.

Related discussion that you may find useful to look - How to write stories / scenarios in BDD. And a very comprehensive article from Code magazine - Behavior-Driven Development

ps: In general, UML represent general types of behavior, however it can still be used to model your design with right set of selected category (like a sequence diagram). I would reference the Wikipedia and find the right UML diagram category to use.

share|improve this answer
    
It seems to be a problem definition or development management approach. I was actually talking about a lower level design, closer to the solution. –  Julio Rodrigues Sep 15 '12 at 1:27
add comment

There are behavior models, also, in UML that you can use to depict the behavior of the system like Sequence Diagrams or State Chart Diagram

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.