Alibabacloud.com offers a wide variety of articles about interface or abstract class, easily find your interface or abstract class information here online.
1. Instantiate the interface:One day, we want to call a method of a class by reflection, but we find that there is an interface in the method parameter, we all know that the interface cannot be instantiated, what should we do?Example:public class
There are two mechanisms for Java to provide multiple implementations of an abstraction-Interface and abstract class.Interface and abstract class,In addition to the obvious differences (i.e., the ability to provide a basic implementation),The
Content Overview What are the six design principles of one, single responsibility principle two, the Richter substitution principle three, the dependence inversion principle four, the interface isolation principle Five, the Dimitri Law six, the open
1. Single Responsibility Principle (SRP: single Resposibility Principle)
"Responsibility" or "cause of change" is used to determine whether an interface or class is well designed. However, "responsibility" and "cause of change" are both
First, the importance of design in software developmentImportanceWhen we went to college, we always didn't understand why we had to talk about such a theoretical thing, it was just a feeling that it was useless, we wanted to learn something that we
1. Single Duty principle (Responsibility Principle)Definition: There should be and only one cause for class changesNote: The classes here refer not only to classes, but also to methods and interfaces, such as a method we often say to implement a
1. Single responsibility principle (SRP)(1) ConceptThe single responsibility principle is defined as: there should be only one reason for the class to change, that is, a class is responsible for only one responsibility.For example, let Class C be
I. Single principle of responsibilityThe English name of the single duty principle is responsibility principle, abbreviated as the SRP. The single principle of responsibility is the single of functions within the class or interface, reducing the
Original address: http://www.cnblogs.com/muzongyan/archive/2010/08/05/1793454.htmlOpen Closed Principle is the most basic design principle in the Java world, which guides how we build a stable and flexible system.Defined:A software entity such as
Six Design Principles
Single Responsibility Principle
Rys replacement principle
Dependency inversion principle
Interface isolation principle
Dimit Law
Principle of opening/closing
1. Single Responsibility
Defined:
A software entity such as classes, modules, and functions should be open to extensions and closed for modification.
The definition of the opening and closing principle has clearly told us that software entities should be open to extensions
Conceptual summary of Design principles
Read the design patterns of Zen, the design principles to do a summary of the concept, if you want to better understand, or to see the specific details, this side can only be a rough summary, as a learning
Dependency inversion principle
Definition:
A. High-level modules should not depend on low-level modules. Both of them should depend on abstraction.
B. abstraction should not depend on details. Details should depend on abstraction.
Abstract: an
Tell a story. Once upon a time, a boss was very rich and liked digital products and mobile phones. He often liked to buy smart phones. How can he buy them? Of course, you can buy at various mobile phone stores, such as Apple stores and Samsung
Learn simple Factory mode, feel very useful. When you create an object, you can detach complex initialization operations from the client and simplify the client code. Greatly reduces the difficulty of code modification. And you can create different
Design patterns, and the "routines" in software design. Each pattern describes a recurring problem around us, and the core of the problem solution, so that you can use it again and again without having to do repetitive work. There are more than 20
Open Closed principle is the most fundamental design principle in the Java world, and it guides us in building a stable and flexible system.
Defined:
A software entity such as classes, modules, and functions should be open to extensions and closed
Objective
Time flies, the teenager is still running ... Ⅰ. The Richter Replacement principle
Brief: On the Richter replacement principle, there may be a use of this principle in every day's code, but it has been used all the time, without realizing
Policy mode: defines a series of algorithms, encapsulates each algorithm, and enables them to replace each other. This mode allows algorithms to change independently of customers who use it. Is A behavior pattern. Rule mode includes three types of
6. Opening and closing principle (Open Closed PRINCIPLE,OCP)6.1 definition(1) A class should be open to the extension and closed for modification . It is required to implement the change by extension, and it is extensible without modifying its own
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.