Home  >  Article  >  类库下载  >  Java Basics Learning -- Design Principles of Java (OOP) Programs

Java Basics Learning -- Design Principles of Java (OOP) Programs

高洛峰
高洛峰Original
2016-10-09 16:24:301780browse

Basic learning of Java -- Design principles of Java (OOP) programs

Avoid code duplication. Solution: function, parent class;

encapsulation. Try to keep the member variables of each class private, encapsulate data with operations, and reduce direct calls to member variables between classes. Instead, call methods to reduce coupling;

Maximize scalability. Try to use the framework + data model. You can use containers to avoid hard coding. Avoid large-scale code modifications when functionality is expanded in the future.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn