Are UML class diagrams adequate to design JavaScript systems?

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 about the real world domain here; it’s a model for the solution that I’m trying to achieve.

5

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.

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.

1

There has been work done to adapt web application to UML, its called the WAE extension and there is a book called Building Web Applications with UML by Jim Conallen explaining it in detail. You can see variables and function of JavaScript in the class diagram.

Why i believe its the best option to model web application ? Because evrybody know how class diagram works and this is the closest thing to it. Its very easy to understand and programmers are too lazy to read documentation in words, but looking at a diagram is not that hard ;). However, if you want to see what happens at the execution, then you should look for a sequence diagram because in web application, sometime files are generated dynamically.

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

Yes, you can use UML, most notably sequence diagrams.

With regard to the use of class diagrams, it depends on whether you design your application using object oriented design principles or not. If you have just a bunch of JavaScript functions, class diagrams don’t add much. If you use JavaScript object prototypes to simulate a kind of classes, then these diagrams will be useful.

Based on my experience in designing Javascript front-ends in UML, I have written a white paper on the subject: Technical design in UML for Angular applications.

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.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật