UML——它仍然是软件标记/预开发/可视化的流行方法吗?
在我的面向对象编程课程中,我们学习了 UML 的一些主要概念,我只是想知道 UML 在现实世界中是否常见,或者是否有更流行的方法。
In my object oriented programming class, we learned some of the main concepts of UML and I was just wondering if UML is common in real world situations or are there more popular methods.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当然有一些组织依赖 UML,其中包括一些可能希望您在面试中使用 UML 回答 OO 设计问题的组织。另外,像 Doxygen 这样的文档工具可以生成类似 UML 的图表来描述类层次结构。
除此之外,我在学术界或工业界合作过的大多数团体并没有真正使用它。如果您想了解原因,请阅读“UML 热病致死”。
There are certainly organizations that rely on UML, including a few that may expect you to answer OO design questions with UML in an interview. Plus, documentation tools like Doxygen generate UML-like diagrams to describe a class hierarchy.
Beyond that though, most groups I've worked with in academia or industry don't really use it. If you want an explanation of why, read "Death by UML Fever".
总体同意@chrisaycock。添加几件事:
您应该区分使用 UML 进行规范和文档。在其炒作曲线的顶峰,UML 被吹捧为前者。因此,开发流程要求在编写代码之前先使用 UML 进行建模。这种使用已经大大减少(尽管仍然有一些地方使用可执行的 uml,特别是在实时/嵌入式环境中)。
作为一种文档工具,UML 仍然很流行。例如,UML 类图可以比线性代码更直观、更直观地传达模块的结构。类似地,序列图或活动图对于理解超越多个类的操作的控制流非常有用。
在文档上下文中,UML 图越来越多地自动生成,而不是手动创建,例如从 doxygen (如 @chrisaycock 提到的)。
然而,它对于在开发之前绘制设计草图(例如在白板上)仍然有用。
嗯。
Generally agree with @chrisaycock. Would add a couple of things:
You should distinguish using UML for specification versus documentation. At the peak of its hype curve, UML was touted as the former. So development processes mandated modelling in UML before moving into code. That use has diminished greatly (although there are still pockets using executable uml, notably in real-time/embedded environments).
As a documentation tool, UML is still popular. UML class diagrams, for example, can convey the structure of a module in a way that is much more revealing and intuitive than linear code can ever be. Similarly sequence- or activity diagrams are very useful for understanding flow of control for an action that transcends a number of classes.
In the documentation context UML diagrams are increasingly being generated automatically rather than being manually created, e.g. from doxygen (as @chrisaycock mentions).
However it's also still useful for sketching out designs ahead of development e.g. on a whiteboard.
hth.
我曾经参加过关于嵌入式系统中的 UML 和 MDA 的问答会议,小组成员包括作者 Bruce Powell Douglass 和 Steven Mellor。之前我曾研究和研究过 RT-SSADM 项目和 Ward-Mellor 方法,因此我向 Stephen Mellor 提出了质疑,为什么每 10 年就会出现一种新的软件设计方式,而从业者却很难掌握或真正理解上一种方式。他的回答也许太诚实了:“这样我就能卖更多的书”!
因此,在某种程度上,我认为围绕任何特定符号或方法的炒作主要是由 CASE 工具供应商和出版社推动的;通常,作者也受雇于工具供应商,并拥有“首席布道者”等头衔。
这并不是说这些工具没有价值;而是说这些工具没有价值。我们都应该对这种营销保持警惕,但另一方面,我们也需要以明确和清晰的方式传达我们的想法和设计,使用明确的符号,无论多么不优雅,总是比一些临时的“棍子和棍子”要好。框”符号没有明确的语义。考虑到通信的需要,UML(以及 SysML 等衍生品)是目前最广泛接受和使用的表示法,并且目前享有最广泛的工具支持。它与以前的许多不同之处在于它被定义为多方同意的标准,而不是单个作者或 CASE 工具供应商的工作,因此它很可能会发展而不是消失。
I once attended a Q&A session on UML and MDA in embedded systems where the panel included authors Bruce Powell Douglass and Steven Mellor. Having previously studied and worked on RT-SSADM projects and the Ward-Mellor methodology, I challenged Stephen Mellor on why a new way of software design comes along every 10 years before practitioners have hardly gotten to grips or truly understood the last one. He responded rather too honestly perhaps with "this way I sell more books"!
To some extent therefore I suggest that the hype surrounding any particular notation or methodology is driven primarily by CASE tool vendors and publishing houses; often the authors are also employed by the tool vendors and have titles like "Chief Evangelist".
That is not to say that these tools have no value; we should all be wary of such marketing, but on the other hand we also need to communicate our ideas and designs in an unambiguous and clear manner, and using a defined notation however inelegant, will always be better than some ad-hoc "sticks and boxes" notation that has no definitive semantics. Given that need for communication, UML (and derivatives such as SysML) is currently the most widely accepted and used notation, and currently enjoys the widest tool support. It differs from much that has gone before by being defined as a standard agreed by multiple parties rather the work on a single author or CASE tool vendor, so it is likely to develop rather than disappear.
我认为由 @chrisaycock 链接的这篇文章也可能有推论,例如“死于敏捷发烧”、“死于 CMM 发烧”、“死于 RT-SSADM 发烧”,...;-)
正如 @sfinnie 所说,它实际上取决于用法,但 UML 本身只不过是一种符号。为了真正有用,您需要遵循一些开发方法。尽管@Clifford 的帖子,我还是推荐一种成熟的方法。可执行 UML 最初名为 Shlaer-Mellor,已使用 19 年以上。道格拉斯的方法(不再称为 ROPES,但是???)已经存在 11 年了。统一流程基于 Booch、OMT 和 OOSE 方法,因此也可以认为已有 19 年以上的历史。当然,您可能会发现其他更适合您需求的 UML 或非 UML 开发方法。
I think the article, linked by @chrisaycock, could also have corollaries e.g., "Death by Agile Fever", "Death by CMM Fever", "Death by RT-SSADM Fever", ... ;-)
As @sfinnie stated, it really depends upon the usage, but UML by itself is nothing more than a notation. In order to be really useful, you need to follow some development method. @Clifford's post not withstanding, I'd recommend a mature method. Executable UML started as Shlaer-Mellor and has been in use for 19+ years. Douglass' method (not called ROPES anymore, but ???) has been around for 11 years. The Unified Process is based on Booch, OMT, and OOSE methods, so it can be considered 19+ years old as well. Of course you might find some other UML or non-UML development method that better fits your needs.