Java's OOAD

Source: Internet
Author: User

1.UML

A. Full name: Unified Modeling Language

B.UML diagram: Flowchart, use case diagram, time series diagram, class diagram

C. Between the interface and the class--implementation

D. Between objects and objects

① generalization--is not called inheritance in UML, but is called generalization

② Association

Dependency: Use A is a weakly associative relationship

Aggregation: Has a whole and part of the relationship, but separable

Combination: Contains a whole and part of the relationship, but cannot be separated (also known as strong aggregation)

Note: In Java, aggregation and composition are basically the same, and there's no big difference

2. Design principles

A. Standards for measuring the quality of software design: readability, reusability, scalability, maintainability

B. Standard summary: cohesion, low coupling

C. Seven major principles:

① Single Duty principle: A class should have only one cause for his change

② Opening and closing principle: open to expansion, closed for modification (core principle)

③ Richter Substitution principle: After a subclass replaces all the parent classes, it works as expected

④ relies on the reverse principle: high-level modules should not rely on low-layer modules, they should rely on abstraction

Abstractions should not be dependent on detail, and detail should be dependent on abstraction

⑤ interface Isolation principle: Minimum Interface principle

⑥ combination/Aggregation multiplexing principle: Multi-use combination/aggregation, less inheritance

⑦ Dimitri Law: the principle of least knowledge

Java's OOAD

Related Article

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.