4. The "single-duty" class modelIn the design of software components, if the division of responsibility is not clear, the use of inheritance results often with the change in demand, the subclass of the rapid expansion, and full of repetitive code,
1. Single ResponsibilityDefinition: Do not have more than one cause for class changes. In layman's terms, a class is responsible for only one responsibility.Advantages:1), can reduce the complexity of the class, a class is only responsible for a
The policy mode belongs to the behavior pattern of the object. It is intended for a set of algorithms that encapsulate each algorithm in a separate class with a common interface, so that they can be replaced with each other. The policy pattern
1 Collection MappingsOne buyer corresponds to multiple addressesConfiguration of the Set collectionKeep in mind that because it is a collection, the data type of the data in the collection must be written or otherwise error-List collection
first, interface and normalization of design1. What is an interface 1) is a set of feature sets2) The function of the interface is used for interactive3) The interface only defines functions, but does not involve the implementation of functions 4)
Interface and Normalization design:1. Normalization allows the user not to care about what the object's class is, just know that these objects have some functionality, which greatly reduces the user's difficulty in using it.2. Normalization allows
Basic ConceptsMethod Stacks in Threads When the Java program virtual machine starts, the program code is loaded, and the virtual machines generates into a method call stack for each running line, and the thread runs as the execution unit in the
(1) The difference between struct and class in C: struct is only a struct defined by a complex data type and cannot be used for object-oriented programming; C language has no class keyword.(2) The C + + language of the difference between struct and
decorator often translated into "decoration", I think translated into "painter" more image point, painter (decorator) is used to brush paint, then painted objects we call decoratee. Both of these entities are required in the decorator mode.Decorator
the object-oriented and JVM Basics4 Types of access permissions in 1.java:(1). public: Maximum access control permissions, which are visible to all classes.(2).Protect: The same package is visible, not all subclasses of the same package are visible.(
The difference between struct and class
The difference between struct and class in C: struct is only a struct defined by a complex data type, and cannot be used for object-oriented programming; C language has no class keyword.
The
decorator Pattern Definition The responsibility is dynamically attached to the object. To extend functionality, decorators provide a more resilient alternative than inheritanceImplementing a class Diagram features of decorator modeA decorator
Or to decide on the title of Ajax, after all, many people will use this keyword search. Although I think this is just a hype concept, but have to admit that Ajax is more convenient to call. I'm not going to elaborate on the meaning of Ajax.
The
1. Single Responsibilitydefinition: Do not have more than one cause for class changes. In layman's terms, a class is responsible for only one responsibility. Scenario: Class T is responsible for two different duties: responsibility P1,
1, the interface from the user's perspective (using the implementation of the code) to see the problem.2. An interface is a contract that is enforced by the compiler to collaborate between modules.3, no member variable.4, the member function can
What is object-oriented
An object, that is, a specific individual in an abstract class of things. Everything that exists in this world is an object, and it can be created if it doesn't exist.
Compared to process-oriented differences:
(a) Two-dimensional arrayTwo-dimensional arrays:data type [] [] Array name = new data type [m][n];M: Represents how many one-dimensional arrays are in the current two-dimensional arrayN: Represents the length in each one-dimensional
Just in the forum inadvertently, see the source read the post. Looking back on myself a few years ago, reading the source of the excitement and sense of accomplishment (1), can't help but a kind of excitement.Source reading, I think the core has
Definition: dynamically attaches responsibility to the object. To extend functionality, adorners provide a more resilient alternative than inheritance. Class Diagram: Component: Define a docking interface that can dynamically add responsibilities
1. Questions Travel: We can have several strategies to consider: Can ride bicycles, cars, do trains, airplanes. Each policy can get the same results, but they use different resources. Select the basis for the policyIs the cost, the time, the use of
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.