1. 程式人生 > >UML基本架構建模--開始構建圖

UML基本架構建模--開始構建圖

When you work with an architect to design a house, you start with three things: a list of wants (such as I want a house with three bedrooms and I want to pay no more than x), a few simple sketches or pictures from other houses representing some of its key features (such as a picture of an entry with a circular staircase), and some general idea of style (such as

Wed like a French country look with hints of California coastal). The job of the architect is to take these incomplete, ever-changing, and possibly contradictory requirements and turn them into a design.

在你與一位設計師一同設計一個房子時,就已經開始做三件事:想法列表(如我想要帶有三個臥室的房子我希望支出不要超出),一些表現其它房子的關鍵特徵的簡單草圖或圖片(如一張入口帶有環形樓梯的圖片),風格的一些大致想法(如

我希望法國鄉村看起來象加利福尼亞海岸).設計師的工作就是將這些不完全的,變幻無窮的及可能相互矛盾的需求轉換成設計圖.

To do that, the architect will probably start with a blueprint of a basic floor plan. This artifact provides a vehicle for you and your architect to visualize the final house, to specify details, and to document decisions. At each review, you

ll want to make some changes, such as moving walls about, rearranging rooms, and placing windows and doors. Early on, these blueprints change often. As the design matures and you become satisfied that you have a design that best fits all the constraints of form, function, time, and money, these blueprints will stabilize to the point at which they can be used for constructing your house. Even while your house is being built, youll probably change some of these diagrams and create some new ones as well.

這樣,設計師有可能開始於基本的地板平面設計圖.這個半成品為你和你的設計師將房子的最終形式細節描述和記錄下的決定形成思維影象提供了一個媒介,在每次回顧時,你會想做些改變,如移動牆,重新安排房間,放置門和窗.在早期,這些藍圖變動頻繁.隨著設計的成熟,同時你滿意於你有一個最好的設計--不管在形式上,功能上,時間和金錢上都符合你的預期.這些藍圖穩定在可以用於構建你的房子的那個點上.甚至在你的房子正在建造的過程中,你仍然有可能改變這些圖和建立新的圖.

Along the way, youll want to see views of the house other than just the floor plan. For example, youll want to see elevations showing the house from different sides. As you start specifying details so that the job can be meaningfully costed, your architect will need to create electrical plans, plans for heating and ventilation, and plans for water and sewer connections. If your design requires some unusual feature (such as a long, unsupported span over the basement) or you have a feature thats important to you (such as the placement of a fireplace so that you can install a home theater), you and your architect will want to create some sketches that highlight those details.

隨著時間的推移,相對於地板設計你會更想看看這個房子的其它構想.例如,你會想從不同側面觀察房子所顯示的立體效果.為了讓這個工作的代價有點意義,你開始描繪細節,你的設計師需要構建電路設計用於取暖和通風的設計供水和下水道連線的設計.如果你的設計需求有些不常用的特點(如一段長的不被支援的跨越地下室的距離)或是一個對你來說很重要的特點(如壁爐的位置,因為你要安裝家庭影院),你和你的設計師會想創造一些草圖來強調那些細節.

The practice of creating diagrams to visualize systems from different perspectives is not limited to the construction industry. Youll find this in every engineering discipline involving the creation of complex systems, from civil engineering to aeronautical engineering, ship building, manufacturing, and software.

實行從不同角度建立圖群來讓系統視覺化並不限於建築行業.你會在每個工程學科涉及複雜系統的創造中找到這個,從土木工程到航空工程,船舶的建造,製造業和軟體.

In the context of software, there are five complementary views that are most important in visualizing, specifying, constructing, and documenting a software architecture: the use case view, the design view, the interaction view, the implementation view, and the deployment view. Each of these views involves structural modeling (modeling static things) as well as behavioral modeling (modeling dynamic things). Together, these different views capture the most important decisions about the system. Individually, each of these views lets you focus attention on one perspective of the system so that you can reason about your decisions with clarity.

在軟體方面,有五個互為補充的檢視,它們在視覺化敘述化結構化文件化一個軟體的體系結構上非常重要:用例檢視,設計檢視,互動檢視,實施檢視和佈署檢視.這些檢視的每一個都涉及到結構建模(建模靜態事物)以及行為建模(建模動態事物).放在一起時,這些不同的檢視捕捉關於系統的最重要的決定.單獨存在時,這些檢視的每一個讓你專注於系統的一個方面,以便你能明確為什麼做這個決定.

When you view a software system from any perspective using the UML, you use diagrams to organize the elements of interest. The UML defines different kinds of diagrams, which you can mix and match to assemble each view. For example, the static aspects of a systems implementation view might be visualized using class diagrams; the dynamic aspects of the same implementation view might be visualized using interaction diagrams.

在你使用UML從任意角度觀察一個軟體系統的時候,你使用圖來組織感興趣的元件.UML定義了不同類別的圖群,你可以混合搭配來組合每個檢視.如系統實施檢視的靜態方面可以使用類圖表現;這個實施檢視的動態方面可以使用互動圖表現.

Of course, you are not limited to the predefined diagram types. In the UML, diagram types are defined because they represent the most common packaging of viewed elements. To fit the needs of your project or organization, you can create your own kinds of diagrams to view UML elements in different ways.

當然,你不必限制在已定義的圖型別上.在UML中,圖型別被定義是因為它們表現最常用的檢視元件包.你的專案或是你的組織為適應這個需要,可以建立你自己的圖群種類來用不同的方式表現UML的元件.

Youll use the UMLs diagrams in two basic ways: to specify models from which youll construct an executable system (forward engineering) and to reconstruct models from parts of an executable system (reverse engineering). Either way, just like a building architect, youll tend to create your diagrams incrementally (crafting them one piece at a time) and iteratively (repeating the process of design a little, build a little).

使用UML圖群有兩個基本的方式:描繪的模型可構造一個可執行的系統(前向工程)及從一個可執行的系統重構模型(逆向工程).不管哪種方法,你就像一個建築設計師,慢慢地(在一段時間製作它們中的一塊)迭代地(重複著這個過程:設計一點,建立一點)建立好你的圖群.