What does the arrow mean in a Class Diagram?

I need help trying to understand what the meaning of the arrow in a UML Class Diagram is, more specifically in this Composite Diagram. What’s the difference between the simple line (from a class to another one) and the arrow (not the inheritance arrow, I refer to the black one)?

0

In order to better discuss the image, I annotated your image with some numbers. Hopefully this will help me be more clear in my writing.

There are really three types of lines used here – association (1), composition (4->2), and inheritance (3).

A solid line connecting two classes, such as between Client and BookComponent is simply an association relationship. It is often used to indicate that a class knows about (perhaps as in receives as an argument to a method) or has another class (perhaps as an instance variable). Without any decorations or with an arrow on both ends, the relationship is bidirectional – the two classes share the relationship and know about each other. In some cases, such as line 1 in the figure, the relationship is directional. The Client class knows about BookComponent, but the opposite is not true as BookComponent does not have a or know about Client. Note that there are also other annotations that can appear on association relationships, such as multiplicity or class roles.

The next line is the line that connects BookComposite to BookComponent. It’s an association, much like the line between Client and BookComponent. However, the annotations at the points I labeled 2 and 4 add additional information about the relationship. Line in point 1, the arrow at point 2 means the same thing – BookComposite is aware of BookComponent instances, but not the other way around (a directional relationship). The annotation at point 4 indicates an aggregation relationship – BookComposite is a collection of BookComponent. However, it’s not a strong relationship (as is the strong composition relationship), so aggregation indicates that a BookComponent can indicate in places outside a BookComposite (you don’t need a BookComposite to have a BookComponent).

Something to note is that the arrow used to show directional associations is typically not a solid black arrow as shown in this image. I typically see it as an open arrow that looks more like a v than what is shown in your image.

Finally, the point labeled 3 is the inheritance relationship that you mentioned in your question.

If you’re interested in more about UML modeling, I’d recommend purchasing UML Distilled. It’s a good book by Martin Fowler that covers class, sequence, object, package, deployment, use case, state machine, activity, communication, composite structure, component, collaboration, interaction overview, and timing diagrams.

2

Your picture shows several different relationships.

The relationship between the Client and BookComponent classes is a Containment relationship. I.e. the Client Contains an instance of BookComponent.

BookComposite and BookComponent has two relationships the open arrowhead is a Generalization relationship (i.e BookComponent generalizes BookComposite or in other terms BookComposite specializes/derives from BookComponent). The closed-arrohead with a diamond at the tail is an Aggregation. That is, BookComposite contains a Collection of BookComponent. The fact that the Diamond is not filled is significant too. It means that the lifecycle of the contained BookComponents is not tied to the life of the containing BookComposite. If it were filled instead of Aggregation, it would be a Composition and when BookComposite was destroyed, so would be the BookComponents

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật