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

Làm thế nào để mô hình các lớp học bao gồm các lớp khác. Làm thế nào để mô hình giao diện và kết nối của họ với các lớp học. Khái niệm khả năng hiển thị Tập hợp sự hiểu biết, Composites, giao diện, và chứng ngộ | HOUR 5 Understanding Aggregations Composites Interfaces and Realizations What You ll Learn in This Hour How to model classes that consist of other classes How to model interfaces and their connections with classes The concept of visibility You ve learned about associations multiplicities and inheritance. You re almost ready to create meaningful class diagrams. In this hour you ll learn the final pieces of the puzzle as you delve into additional types of relationships and other issues connected with classes. The ultimate goal is to be able to create a static view of a system complete with all the interconnections among the system s classes. Aggregations Sometimes a class consists of a number of component classes. This is a special type of relationship called an aggregation. The components and the class they constitute are in a part-whole association. In Hour 2 Understanding Object-Orientation I mentioned that your home computer system is an aggregation that consists of a CPU box a keyboard a mouse a monitor a CD-ROM drive one or more hard drives a modem a disk drive a printer and possibly some speakers. Along with the drives the CPU box holds RAM a graphics card and a sound card and probably some other items . 80 Hour 5 You represent an aggregation as a hierarchy with the whole class for instance the computer system at the top and the components below. A line joins a whole to a component with an open diamond on the line near the whole. Figure shows the computer system as an aggregation. FIGURE An aggregation part-whole association is represented by a line between the component and the whole with an open diamond adjoining the whole. Although this example shows each component belonging to one whole in an aggregation this isn t necessarily the case. For example in a home entertainment system a single remote control might be a component both of a television and of a VCR. Constraints on Aggregations Sometimes the set of possible components in an aggregation falls

TÀI LIỆU MỚI ĐĂNG