Combination and Aggregation

Source: Internet
Author: User

The combination and polymerization have been relatively vague and are now recorded.

"Turn" http://www.blogjava.net/lukangping/archive/2010/08/01/327693.html

Aggregation: Represents a " weak relationship" between the two objects as a whole and a part, and part of the life cycle can transcend the whole. such as a computer and mouse, you can use a shape to indicate:

Combination: Indicates that two objects are " strong relationships" between the whole and the part, and that part of the life cycle cannot go beyond the whole or be absent from the whole. The "part" of a combined relationship cannot be shared across the whole. such as the relationship between human and eye:

The other two more important relationships are associations and dependencies:
Association: It is simple to think that if a class is a property of another class, it must be an association. But you know, aggregation is a special kind of association, and a combination is a special kind of aggregation . The General Association we think is a lateral, not integral part of the relationship, such as a friend relationship.

Dependencies: Temporary relationships between objects, which are temporarily reflected in periods that do not transcend methods. Simply put, in a method used, such as the parameter class, it must be a dependency relationship.

"Multi-use combination, less aggregation"

Combination and Aggregation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.