Các loại sơ đồ sử dụng để cung cấp cho một bức tranh hoàn chỉnh của sự hợp tác phụ thuộc vào trường hợp thực tế. Trong một số trường hợp, một sơ đồ có thể là đủ, trong các trường hợp khác, một sự kết hợp của sơ đồ khác nhau có thể là cần thiết. Kịch bản là một thể hiện của một trường hợp sử dụng. | Classes Objects and Their Relationships 135 Cable Box 1 Television Track Usage Billing Information Signal Figure Example of port notation showing a cable box as a component with requirements in the external environment. Figure provides an example of a port. In the example a television requires signal input from an external source and a cable company wants to be able to track the usage of the television set. So the cable box port provides this interface while also implementing interfaces that allow the cable company to charge the user and track his or her television-watching history. Packages A package provides a grouping mechanism for organizing UML elements. In UML a package is used to group elements and to provide a namespace for the grouped elements. All model elements that are owned or referenced by a package are called the package contents. As a grouping mechanism for model organization the package does not have an instance. Thus the packages often have a meaning during modeling that is not necessarily translated into the executable system. A package owns its model elements and a model element cannot be owned by more than one package. If the package is removed from the model then its owned elements are also removed. See Figures through for examples. The package is shown as a large rectangle with a smaller rectangle a tab attached on the upper-left corner of the large rectangle the common folder icon . If the contents such as classes of the package are not shown then the name of the package is given inside the large rectangle otherwise the name is given inside the small rectangle. Owned and imported elements may each have a visibility that determines whether they are available outside the package. The visibility of a package element may be indicated by preceding the name of the element with a plus sign for public a minus sign - for private. The public contents of a package are always available through the use of qualified names. 136 Chapter