UML實例--HELL_WORLD(一)



UML實例--HELLO, WORLD!(一)

Brian Kernighan and Dennis Ritchie, the authors of the C programming language, point out that the only way to learn a new programming language is by writing programs in it. The same is true of the UML. The only way to learn the UML is by writing models in it.

The first program many developers write when approaching a new programming language is a simple one, involving little more than printing the string Hello, World! This is a reasonable starting point, because mastering this trivial application provides some instant gratification. It also covers all the infrastructure needed to get something running.

This is where we begin with the UML. Modeling Hello, World! is about the simplest use of the UML youll ever find. However, this application is deceptively easy because underneath it all there are some interesting mechanisms that make it work. These mechanisms can easily be modeled with the UML, providing a richer view of this simple application.

 

布賴恩·克尼漢和丹尼斯·裏奇,C程序語言的作者,指出學習一門新程序語言的唯一方法就是用這門語言編程.這對於UML也同樣適用.學習UML的唯一方法就是用它建模.

大多數的開發人員在接觸一門新程序設計語言時所寫的第一個程序通常都是打印字符串你好,世界!這是個合理的開端,因爲熟練掌握這種小應用能獲得即時的滿足感.它也涵蓋了爲讓某些東西運行起來的所有的基礎需要.

我們也從這裏開始學習使用UML吧.模型你好,世界!是你所能找到的關於UML最簡單的應用.不管怎樣,這個應用是很容易因爲下面它擁有的一些有趣的機制讓它工作.這些機制用UML建模是很容易的事,這個簡單的應用提供了豐富的視圖.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章