《UML for Java Programmers》读书笔记——第二章



为了整理自己写的代码,重看了《UML for Java Programmers》。觉得第二章的《Working with Diagrams》特别精彩,讲清了用UML的目的,什么时候用UML,什么时候不用。


作者从为什么要建模开始讨论。


so,为什么建模?

1. Models are built to find out if something will work.
2. We investigate designs with models when the models are much cheaper than the real thing we are building.


建模在软件领域有什么作用呢?(Why build models of software?)

为了测试,不能测试的模型没有存在的意义,虽然测试UML是一个非常主观的事情。
“We make use of UML when we have something definitive we need to test, and when using UML to test it is cheaper than using code to test it.”。这里的测试对象是软件设计。你在白板上画了一个设计方案,你同事就可以检查你的设计。


此外,使用UML的目的是为了沟通和做最后的知识积累。积累下来的UML图可以让后来者快速熟悉系统。


UML图该存下来吗?

UML既然是为了沟通用,应该是用完就扔掉,不该存下来,除非“There are diagrams that record designer intent in a way that is better than code can express it.”


如何使用UML?
作者提到,任何人类能做好的事情,都是一小步一小步慢慢弄出来的,UML图也不例外。开始可以很简陋。同时,作者还建议从行为(Collaboration Diagram)入手画UML,一边调整动态的Collaboration图,一边调整静态的Class Diagram。最重要的,在画UML图时脑中要有实现的代码,不能和代码对应的UML图是空中楼阁,没有任何价值。
“Stop what you are doing, and figure out how to translate it to code.”


UML是一种语言,为了表达你的设计,只要别人理解了你的设计,就可以停止画图了。上面提到的检查你的设计,怎么检查呢?有没有标准?有标准,标准在书里也提到了,S、O、L、I、D这五个原则。当然,这是后面几章的内容。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<br>UML:Java程序员指南<br><br>【原 书 名】 UML For Java Programmers <br>【原出版社】 Pearson Education Prentice Hall/Pearson <br>【作 者】Robert C. Martin <br>【译 者】 黄晓春 <br>【丛 书 名】 软件工程实践丛书 <br><br><br>【内容简介】<br>面向对象大师Robert Martin新作,直言不讳地指出UML的局限性,指导程序员高效地使用UML,以避免盲目使用UML所带来的灾难性后果。<br>Amazon网站读者对本书的评价:<br>● 实际的智慧、提示、技术和技巧<br>● 杰出的UML和OO设计基础读物 极佳的学习材料!<br>● 这本UML书是你惟一所需的<br>● C++程序员也应该看看这本书<br>● 有助于Java设计团队<br>● 团队程序员(和他们的经理)必读<br>● 对UML的最佳诠释,对Java程序员而言,尤其如此<br>● 杰出的UML和OO设计基础读物<br>这是世界一流面向对象大师Robert C. Martin的最新著作。作者以独特的视角,着重为Java程序员描述了UML的利与弊,指导他们何时应该使用UML,以及如何使用UML。通过本书的阅读,Java程序员将能更加恰如其分地使用UML,进一步提高开发效率。<br>可作为软件开发人员的参考书,也可供高等院校\"UML课程\"使用。本书源代码和授课用的幻灯片可在 http://www.objectmentor.com/resources/bookstore/books/UMLFJP获得。<br><br><br>www.objectmentor.com/UMLFJP<br><br><br>http://images.china-pub.com/ebook15001-20000/19998/shupi.jpg<br><br><br><br>http://www.china-pub.com/19998<br><br>
"I found Real Time UML, Third Edition, to provide an informative and practical application of UML 2.0 to the development of real-time systems, and well worth the read by systems and software engineers. It is written in plain English and provides the right balance of depth and breadth." -Sanford Friedenthal, Deputy, Corporate Systems Engineering, Lockheed Martin CorporationChair, OMG Systems Engineering Domain Special Interest Group The increasing complexity of embedded and real-time systems requires a more premeditated and sophisticated design approach for successful implementation. The object-based Unified Modeling Language (UML) can describe the structural and behavioral aspects critical to real-time systems and has come to the fore as an outstanding medium for effective design. Like its best-selling predecessors, Real Time UML, Third Edition, provides an overview of the essentials of real-time systems and an introduction to UML that focuses on the use of the ever-evolving standard in design and development. This accessible book examines requirements analysis, the definition of object structure and behavior, architectural and mechanistic design, and more detailed designs that encompass data structure, operations, and exceptions. Numerous figures help illustrate UML design techniques, and detailed, real-world examples show the application of those techniques to embedded systems. This significantly revised edition features the new UML 2.0 standard, which dramatically improves the clarity of the UML for capturing architectures and improving its scalability. Real Time UML, Third Edition, also introduces the UML Profile for Schedulability, Performance, and Time (STP Profile). The STP Profile provides a standardized way to capture schedulability and performance constraints of systems. This allows analysis tools to read and analyze UML models. Key topic coverage includes: The Rapid Object-Oriented Process for Embedded Systems (ROPES) Concurrency and resource modeling with the Real-Time (SPT) UML Profile Tapping action semantics for greater executability Scenario modeling with timing diagrams Key strategies for object identification Defining object state behavior Representing and identifying threads Mechanistic design patterns

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值