tailieunhanh - Teach Yourself UML in 24 Hours 3rd phần 4

Đôi khi một lớp học bao gồm một số lớp học phần. Đây là một loại đặc biệt của mối quan hệ được gọi là một tập hợp. Các thành phần và tầng lớp của họ tạo thành một hiệp hội bán toàn bộ. Giờ 2, "Tìm hiểu về đối tượng, định hướng," tôi đã đề cập rằng hệ thống máy tính của bạn là một | 130 Hour 8 FIGURE The history state symbolized by the H in the small circle shows that a composite state remembers its active substate when the object transitions out of that composite state. TimeOut In the state diagram I haven t dealt with windows that are opened by other windows in other words with substates nested within other substates. When a history state remembers substates at all levels of nesting as the Windows Working state does the history state is said to be deep. If it remembers only the highest nested substate the history state is shallow. You represent a deep history by putting H in the circle. New in UML UML has added some new state-relevant symbols called connection points. They represent points of entry into a state or exits out of a state. Here s an example Imagine a couple of the states of a book in a library. At first it s residing on a shelf. If a borrower has called in to reserve the book a librarian retrieves the book and brings it into the state of Being checked out. If a borrower comes to the library browses through the shelves selects the book and then decides to borrow it it enters the Being-checked-out state but in a different way. You can think of each way of getting to the Being-checked-out state as going through a separate entry point. One more thing to be aware of Suppose the borrower has borrowed more than some allotted limit or has a number of unpaid fines. If that s the case the book abruptly exits via an exit point from the Being-checked-out state. Figure shows how to model all this in UML. Each entry point is modeled as an empty circle. The exit point is an encircled X. The circles are on the border of the state icon. Working with State Diagrams 131 z reserved r Residing on Shelf Being Checked Out c 7 ended FIGURE Entry points and an exit point in a UML state diagram. Why Are State Diagrams Important The UML state diagram provides a variety of symbols and encompasses a number of ideas all to model the .