Java review: The relationship between classes in UML diagrams: Dependency, generalization, association, aggregation, combination, implementation __#java revision #

Source: Internet
Author: User

Original: http://blog.csdn.net/fatherican/article/details/44966891

The component thing is the noun, is the static part of the model.
Behavioral things are dynamic parts that represent behavior.
Grouped things are part of the organization.
The annotation thing is the explanation part. Dependence: A change in one thing can cause another to change. Descriptive: Dashed + solid triangle or dashed + solid arrow
Aggregation: A special association that describes the combined relationship of a whole and a part.
Generalization: A special and general relationship, such as a child element (special) and a parent element (general), and an arrow pointing to a parent element.
Implementation: The relationship between the classes, where one class element specifies a contract that is guaranteed to be executed by another class element. It is generally used between interfaces and implementing their classes or between use cases and the collaboration that implements them. UML offers 9 kinds of views: Class Diagrams, object graphs, use case diagrams, Sequence diagrams, collaboration diagrams, State diagrams, activity diagrams, component diagrams, and deployment diagrams.

Pick up the Picture:



What is the difference between dependency and aggregation, combination, association, etc.
Association is a kind of relationship between classes, for example, teachers teach students, husbands and wives, water bottles and so on is a kind of relationship. This relationship is very obvious and can be obtained directly through analysis in the problem area.
Dependency is a weak association, as long as one class is used to another, but the relationship with another class is not too obvious (it can be said that the class is "uses"), it is possible to see this relationship as dependence, and dependence can be said to be an accidental relationship, not an inevitable one, that is, "I have stumbled upon it in a method, But in reality I don't have much to do with it. " For example, I and the hammer, I have no relationship with the hammer, but in one time to nail the nail, I used it, this is a dependency, rely on the hammer to complete the nail this thing.
A combination is a whole-part relationship, which is obvious in the problem domain and can be obtained by direct analysis. For example, the tyre is part of the car, the leaves are part of the tree, the hands and feet are part of the body of this relationship, very obviously the whole-part relationship.
Several of these relationships (associations, aggregates/combinations, dependencies) may appear in the code as pointers, references, values, and so on in another class, not in form, but logically they are different.

Reference: http://blog.csdn.net/blues1021/article/details/45739941


Practice JAVA Collection UML Diagrams:




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.